Page 1 of 1

ARC Drawing

Posted: Fri Jun 15, 2012 3:55 pm
by jackymb
hi,

it would be possible to add a function in library 2DDrawing :

Arc(x, y, Radius, StartAngle, EndAngle [, Color])

x, y Specifies the position of the center pixel of the ARC.
Radius Specifies the radius of the ARC.
StartAngle Specifies Angle of departure
EndAngle Specifies end angle
Color (optional) Specifies the color to be used for the ARC.

optionally the direction of rotation (clockwise / counterclockwise)

Best regards

Re: ARC Drawing

Posted: Fri Jun 15, 2012 5:19 pm
by IdeasVacuum

Re: ARC Drawing

Posted: Fri Jun 15, 2012 7:14 pm
by jackymb
thank you IdeasVacuum

purpose is limited to windows. why not a function for every OS :!: :o

Re: ARC Drawing

Posted: Wed Mar 30, 2016 7:13 am
by collectordave
Hi

I am using PB 5.4 vectordrawing commands to draw an arc as you ask. If you take a look at this http://www.purebasic.fr/english/viewtop ... +Module%3A you can draw an arc as specified.

The programme asks for the start\anchor point of the arc and then draws a circle which revolves around the anchor point and changes size\position with the mouse moves. This allows you to set the position and radius of the desired arc. A full circle is used here to show all possible arcs from that point. Once clicked you are asked to set the start angle of the arc and again after setting i.e. clicking the left mouse button you set the end angle in a clockwise direction again using the mouse. Once happy with the end angle click the mouse again and the arc is drawn.

With this it is possible to draw an arc anywhere on your drawing area.

Hope it helps

Regards

CD

Re: ARC Drawing

Posted: Wed Mar 30, 2016 8:30 am
by davido
Pity it does not use CanvasGadget! :)

Re: ARC Drawing

Posted: Wed Mar 30, 2016 3:49 pm
by collectordave
Hi

It does use the canvas gadget the whole drawing surface is a canvas gadget, it needs a lot of the mouse commands. :D

Re: ARC Drawing

Posted: Wed Mar 30, 2016 7:54 pm
by davido
@collectordave,
Thank you for correcting me. :oops:

Re: ARC Drawing

Posted: Sat Apr 16, 2016 1:09 pm
by collectordave
Arc(x, y, Radius, StartAngle, EndAngle [, Color])
Is it just me or does that look very similar to the AddPathCircle vector command?

Code: Select all

AddPathCircle(x.d, y.d, Radius.d [, StartAngle.d, EndAngle.d [, Flags]])

Re: ARC Drawing

Posted: Sat Apr 16, 2016 2:33 pm
by BasicallyPure
Until the time it becomes a feature in PureBasic you can draw arcs like this.

Arc(x, y, start.f, finish.f, radius.f, color = 0, mode = 0)