DrawArc Example

Need concrete example on how to use DrawArc. Have created a start button under the canvas. In the block section have call Canvas1.DrawArc when Button1.click. Do not know what values to use for left, top, right, bottom, startAngle, sweepAngle. A simple example will do so any arc will be drawn. Thanks

Here you are:

drawAnArc-Unfinished.aia (3.8 KB)

as per the name of the file, it is an unfinished project, but will work in Companion if you “Do It” to the drawArc procedure call block

This sounds to me like the documentation could be improved. Here’s a start though:

The DrawArc method draws an arc within a given rectangle. Specifically, imagine that it draws an oval (or circle) within the rectangle defined by the left, top, bottom, and right coordinates. The startAngle indicates at what angle (in degrees clockwise from the +X axis) to start drawing the arc. The sweepAngle indicates the width of the arc in degrees, starting from the startAngle. The useCenter property controls whether the arc connects to the center (like a pie chart) or not (in which case a chord is drawn from the start to end of the arc). Lastly, the fill parameter determines whether the arc should be filled in with the Canvas’s PaintColor or not.

Note that the top left of the canvas is 0, 0 and the X and Y coordinates grow to the right and down, respectively.

I want to thank TimAI2 and ewpatton for your help in using DrawArc.
I have created a simple youtube video to create an arc. I gave you both credit
at the end of the video. The youtube link follows:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.