Lazarus
Miscellaneous => Suggestions => LCL => Topic started by: hy on September 23, 2014, 08:00:58 pm

Hi,
As already stated somewhere else I am porting a big project from Delphi to Lazarus.
Most of the app is displayed graphically on a TCanvas.
I am making use of Method arc a lot.
Obviously the ArcMethod does not behave like arc in delphi.
The first 4 parameters are equal but then there are 4 parameters I do not undrestand  at least not the last 2
See: http://lazarusccr.sourceforge.net/docs/lcl/graphics/tcanvas.arc.html
I do not know what to do. Trial and error did not get me somewhere...
I tried Pie and radial pie but they are different and draw additional lines that I do not want.
Any help apreciated  Thanks in advance

If you use the overloaded Arc() which takes 8 integer parameters, the first four specify the enclosing rectangle of the ellipse from which the arc is a segment, params 5 and 6 are the start point, and params 7 and 8 the end point. 'Start' and 'end' being counterclockwise movement round the ellipse perimeter.
The parameter that does not have to be given is the centre point of the ellipse (since it can be determined from the first four parameters).
The arc drawn is the curve between the intersection of the (imaginary) start line (centre to start point) with the ellipse, and the intersection of the end line (centre to end point) with the ellipse.

Thanks for answering. Meanwhile I found out by trial and error.
I will post a demo tomorrow. Ithink I got that now, but have to go to bed now.

Attached you will find a simple demoproject.
You can play around and test for yourself.
There is some explanation in source code how arc works with lazarus (using gtk)