J
Johnny J.
I've got an inherited control where I want the user to be able to specify a
color property. Using that color, I'm drawing a line
private m_UserDefinedColor as Color
.....
Dim g as Graphics=this.CreateGraphics
Dim myPen as Pen = new Pen(m_UserDefinedColor)
g.DrawLine(myPen, X1, Y, X2 - 1, Y)
Then I want to draw a triangle filled with the same color. I set the point
and do:
g.FillPolygon(Brushes.Red, leftTriangle);
Because I can't figure out how to create a Brush that has the userdefined
color.
It's not possible to do: myBrush as Brush = new Brush(m_UserDefinedColor)
How do you specify the Brush Color in this case?
Cheers,
Johnny J.
color property. Using that color, I'm drawing a line
private m_UserDefinedColor as Color
.....
Dim g as Graphics=this.CreateGraphics
Dim myPen as Pen = new Pen(m_UserDefinedColor)
g.DrawLine(myPen, X1, Y, X2 - 1, Y)
Then I want to draw a triangle filled with the same color. I set the point
and do:
g.FillPolygon(Brushes.Red, leftTriangle);
Because I can't figure out how to create a Brush that has the userdefined
color.
It's not possible to do: myBrush as Brush = new Brush(m_UserDefinedColor)
How do you specify the Brush Color in this case?
Cheers,
Johnny J.