Drawing an elliptical arcΒΆ

ArcTo()

Draw an elliptical arc


SYNTAX

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

Draw an elliptical arc. The arc is drawn using the current pen; it is not filled.

The curve of the arc 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 arc extends counter-clockwise from the point where the ellipse intersects the first radial to the point where it intersects the second radial.

A line is drawn from the current position to the starting point of the arc. If no error occurs, the current position is updated to the ending point of the arc.

window_id

The identifier of the window in which the arc 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 radial defining the starting point of the arc

yradial1

The y co-ordinate of the endpoint of the radial defining the starting point of the arc

xradial2

The x co-ordinate of the endpoint of the radial defining the ending point of the arc

yradial2

The y co-ordinate of the endpoint of the radial defining the ending point of the arc


NOTES

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


EXAMPLE

In the example on the left the bounding rectangle and ellipse are also drawn. Note that a line is drawn from the current draw position to the start of the arc before the arc is drawn.

image0

BeginPaint(wintask,10,10)
SetBrushType(wintask, DB_SOLID)
SetPenColor(wintask, RGB_RED)
SetBrushColor(wintask, RGB_LIME, RGB_WHITE)
Rectangle(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_CYAN, RGB_WHITE)
SetPenColor(wintask, RGB_CYAN)
Ellipse(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_CYAN, RGB_WHITE)
SetPenColor(wintask, RGB_BLACK)
MoveTo(wintask, 30, 10)
ArcTo(wintask,30,10,170,100,50,10,120,80)
SetPenColor(wintask, RGB_MAGENTA)
ArcTo(wintask,220,10,360,100, 240,10,310,80)
EndPaint(wintask)

RELATED TOPICS

Drawing operations

Draw functions