SetArcDirection Function

Declare Function SetArcDirection Lib "gdi32.dll" (ByVal hdc As Long, ByVal ArcDirection As Long) As Long

Platforms: Win 32s, Win 95/98, Win NT

SetArcDirection sets the direction that arcs are drawn in on a graphics-capable device. Arcs can be drawn either clockwise or counterclockwise from the starting point to the ending point. Although Win 95/98 implements this function, that platform ignores the setting specified and always draws arcs counterclockwise! The function returns 1 if successful, or 0 if an error occured.

hdc
The device context of the device to set the arc-drawing direction of.
ArcDirection
Exactly one of the following flags specifying which direction to draw arcs in:
AD_CLOCKWISE = 2
Draw arcs clockwise from the starting point to the ending point.
AD_COUNTERCLOCKWISE = 1
Draw arcs counterclockwise from the starting point to the ending point.

Example:

' Draw the arc that forms the top half of an ellipse.  The ellipse
' is centered at (100, 100), has a width of 200, and has a height of 100.  The arc is drawn
' in red on the window Form1.
Dim retval As Long  ' return value

Form1.ForeColor = RGB(255, 0, 0)  ' set the drawing color to red
retval = SetArcDirection(Form1.hDC, AD_COUNTERCLOCKWISE)  ' draw the arc counterclockwise
' The ellipse is determined by the bounding rectangle (0,50)-(200,150).
' The ray to (200, 100) is due right; the ray to (0, 100) is due left.
retval = Arc(Form1.hDC, 0, 50, 200, 150, 200, 100, 0, 100)

See Also: AngleArc, Arc, ArcTo, GetArcDirection
Category: Lines & Curves

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/setarcdirection.html