Drawing a pie-shaped wedgeΒΆ

Pie()

Draw a pie-shaped wedge


SYNTAX

Pie(window_id, left, top, right, bottom, xradial1, yradial1, xradial2, yradial2)

Draw a pie-shaped wedge, using the current pen to draw the line and filling it with the current brush.

The curve of the pie is defined by an ellipse that fits a bounding rectangle at a specified position. Two radials are also specified - a radial being a line segment drawn from the centre of the ellipse to a specified end point on the ellipse. The curve begins at the point where the ellipse intersects the first radial and extends counter-clockwise to the point where the ellipse intersects the second radial.

window_id

The identifier of the window in which the pie is to be drawn. To print it in the current report, specify NULL instead of a window_id.

The remaining parameters specify the positions of the corners of the rectangle that bounds the ellipse, and of the radials which intersect the ellipse, as follows:

left

The x co-ordinate of the upper-left corner of the bounding rectangle

top

The y co-ordinate of the upper-left corner of the bounding rectangle

right

The x co-ordinate of the lower-right corner of the bounding rectangle

bottom

The y co-ordinate of the lower-right corner of the bounding rectangle

xradial1

The x co-ordinate of the endpoint of the first radial

yradial1

The y co-ordinate of the endpoint of the first radial

xradial2

The x co-ordinate of the endpoint of the second radial

yradial2

The y co-ordinate of the endpoint of the second radial


NOTES

  • If the starting point and ending point of the curve are the same, a complete ellipse is drawn.

  • The current position is neither used nor updated by the Pie function.

  • Under Windows 95/98/ME, the sum of the co-ordinates of the bounding rectangle cannot exceed 32.767, and the sum of the left and right or of the top and bottom parameters cannot exceed 32767.

EXAMPLE

In the example on the left the bounding rectangle and the ellipse have also been drawn.

image0

BeginPaint(wintask,1,1)
SetPenColor(wintask, RGB_RED)
SetBrushColor(wintask, RGB_BLUE, RGB_WHITE)
SetBrushType(wintask, DB_SOLID)
Rectangle(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_MAGENTA, RGB_WHITE)
SetPenColor(wintask, RGB_BLACK)
Ellipse(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_LIME, RGB_WHITE)
Pie(wintask,30,10,170,100, 130,8,70,60)
Pie(wintask,220,10,360,100, 320,8,260,60)
EndPaint(wintask)

RELATED TOPICS

Drawing operations

Draw functions