tags:

views:

83

answers:

1

iam using the swt java library and iam having a problem.

the gc draw arc method takes the following arguments GC.drawArc(int x, int y, int width, int height, int startAngle, int endAngle);

but i want to be able to draw the arc using 3 arguments : the source ,destination and control points.

is there any formula to convert between those parameters ?

QuadCurve2D class do exactly what i want but it is AWT not swt ...and i tried to use java2d under swt but it was very slow ....

any solutions ?

UPDATE:

i have found a solution :

using the the createArcByCenter method in Arc2d Object i can give it the 3 parrameters then get the equivalent x , y, width and height ..to use them with gc object

are there any better solutions ?

A: 

if any one is still wandering (after 3 months) as i have said i used the createArcByCenter method in Arc2d object (had to do some math to get those 3 parameters but easier than the x and y parameters)

you can see a demo here

Ahmed Kotb