When using the arc API call how do I change the drawing color so I get different colour arcs?
Can someone also give me an example of the arc function being used.
Thanks, it would help me out a great deal.
Printable View
When using the arc API call how do I change the drawing color so I get different colour arcs?
Can someone also give me an example of the arc function being used.
Thanks, it would help me out a great deal.
You should be able to change the "ForeColor" Property of the surface you are drawing on.
Z.
Here's an example:
BTW: You can also change the drawing color by creating and selecting a new pen (via API).Code:Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'Set graphical mode to persistent
Me.AutoRedraw = True
'Draw to arcs
Arc Me.hdc, 0, 0, 100, 100, 100, 50, 50, 100
Arc Me.hdc, 49, 49, 149, 149, 49, 99, 99, 49
End Sub
Creating a Pen is the same thing as changing the "ForeColor" property, just wrapped up by VB.
Z.
Yes I know, but if you draw anything on a memory DC, then you can only use APIs