Monday, September 15, 2008

WIN 32 API -ANGLE ARC

AngleArc Function
Declaration

long AngleArc(HDC hdc,long x,long y,long dwRadius,float eStartAngle,float eSweepAngle);

Platforms
· Windows 95: Not Supported
· Windows 98: Not Supported
· Windows NT: Requires Windows NT 3.1 or greater
· Windows 2000: Supported
· Windows CE: Not Supported
Description & Usage
AngleArc draws a circular arc on a device using the device's current pen. The circle
which the arc lies on is determined by its center and radius. The start and end points of
the arc are determined by angle measures in degrees, measured counterclockwise from
the line parallel to the positive x-axis (i.e., from due right). The arc itself is drawn either
clockwise or counterclockwise to connect the points, depending on the device's settings.
AngleArc also draws a line connecting the device's current point to the beginning of the
arc.
Return Value
If an error occurs, the function returns 0 (call GetLastError to get the error code). If the
function succeeds, the function returns a non-zero value.
Parameters
hdc
A handle to a device context of the device to draw the arc on.
x
The x coordinate of the center of the circle.
y
The y coordinate of the center of the circle.
dwRadius
The radius of the circle.
eStartAngle
The angle (in degrees) identifying the starting point of the arc.
eSweepAngle
The angle (in degrees) identifying the ending point of the arc.
Example (C)
// Draw an arc formed by the upper half of a circle (from 0 to 180'
degrees
// counterclockwise). The circle is centered at (100, 150) and has a
radius
// of 50. The arc is drawn using the solid black stock pen.
// (the value of device handle & the old pen selected)
HDC hdc;HPEN holdpen;
// handle to the black stock pen
HPEN hpen=GetStockObject(BLACK_PEN);
// select the pen
SelectObject(hdc, hpen);
// Make sure arcs are drawn going counterclockwise
SetArcDirection(hdc,AD_COUNTERCLOCKWISE);
// Draw the arc
retval = AngleArc(hdc,100,150,50,0,180);
// Select previous pen to restore the "defaults".
SelectObject(hdc, holdpen);

No comments:

Just Answer


JustAnswer.com