# CanvasDrawArc

int CanvasDrawArc (int panelHandle, int controlID, Rect rect, int beginningAngle, int arcAngle, int drawMode);

## Purpose

Draws an arc on the canvas control. Define the arc by specifying a rectangle that encloses the arc, along with a beginning angle, in tenths of degrees, and an arc angle, in tenths of degrees.

The arc is a section of an oval. A beginning angle of 0 indicates that the arc starts at the midpoint of the right edge of the rectangle. The arc angle indicates how far around the oval, counter-clockwise, up to 3,600, to extend the arc.

CanvasDrawArc draws the frame of the arc using the current value of the following attributes:

ATTR_PEN_COLOR
ATTR_PEN_MODE
ATTR_PEN_WIDTH
ATTR_PEN_STYLE (ignored when pen width is greater than one)

CanvasDrawArc draws interior of the arc using the current value of the following attributes:

ATTR_PEN_FILL_COLOR
ATTR_PEN_MODE
ATTR_PEN_PATTERN

The frame of the arc does not include the radius lines going from the center of the oval to the end points of the arc.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
rect | Rect | Rect structure specifying the location and size of the rectangle within which to draw the arc. The Rect structure is defined as follows: typedef struct { int top; int left; int height; int width; } Rect; You can create a Rect without having to declare a variable by using the following function: Rect MakeRect (int top, int left, int height, int width); Example CanvasDrawArc (panelHandle, controlID, MakeRect(20,30,150,200), 0, 90, VAL_DRAW_FRAME);
beginningAngle | integer | Starting angle of the arc, in tenths of degrees. 0 indicates the arc starts at the midpoint of the right edge of the rectangle. 900 indicates that the arc starts at the midpoint of the top edge of the rectangle. Negative values are valid.
arcAngle | integer | Indicates how far around the oval, counter-clockwise, up to 3,600, to extend the arc. This value is specified in tenths of degrees. If the beginning angle is 900 and the arc angle is 1,800, the arc is drawn from the midpoint of the top edge of the rectangle to the midpoint of the bottom edge. Negative values are valid.
drawMode | integer | Specifies whether to draw the arc frame, or interior, or both. The following lists the valid values. VAL_DRAW_FRAME VAL_DRAW_INTERIOR VAL_DRAW_FRAME_AND_INTERIOR The frame of the arc does not include the radius lines going from the center of the oval to the end points of the arc.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success