ARC Drawing

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
jackymb
User
User
Posts: 16
Joined: Wed Aug 11, 2004 7:37 pm
Location: AIX en PROVENCE (France)

ARC Drawing

Post 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
Windows 10 x64/86 - PB 5.73LTS (x86 & x64)
_________________________________________
~English is not my native language I'm using a translator~
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: ARC Drawing

Post by IdeasVacuum »

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
jackymb
User
User
Posts: 16
Joined: Wed Aug 11, 2004 7:37 pm
Location: AIX en PROVENCE (France)

Re: ARC Drawing

Post by jackymb »

thank you IdeasVacuum

purpose is limited to windows. why not a function for every OS :!: :o
Windows 10 x64/86 - PB 5.73LTS (x86 & x64)
_________________________________________
~English is not my native language I'm using a translator~
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: ARC Drawing

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: ARC Drawing

Post by davido »

Pity it does not use CanvasGadget! :)
DE AA EB
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: ARC Drawing

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: ARC Drawing

Post by davido »

@collectordave,
Thank you for correcting me. :oops:
DE AA EB
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: ARC Drawing

Post 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]])
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
BasicallyPure
Enthusiast
Enthusiast
Posts: 539
Joined: Thu Mar 24, 2011 12:40 am
Location: Iowa, USA

Re: ARC Drawing

Post 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)
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.
Post Reply