Hi,
I want to draw an arc using points like p(x,y) and p1(x1,y1). Because i don't know the size of the rectangle to pass.But all drawArc functions in Qt will accept rectangle only.
Regards,
Sugandha
Hi,
I want to draw an arc using points like p(x,y) and p1(x1,y1). Because i don't know the size of the rectangle to pass.But all drawArc functions in Qt will accept rectangle only.
Regards,
Sugandha
An ARC cannot be defined by only two points. It's defined as a ellipse segment, so you must define the ellipse rectangle
A camel can go 14 days without drink,
I can't!!!
As pointed out above there is not enough information with just two points to specify an arc (presumably circular). Do you know the radius and two points, the centre and two points, or something else?
If you know the centre and radius then the bounding rectangle becomes trivial:You can calculate the radius if only the centre is known (you could probably use the QPoint::manhattanLength() function to approximate). You only need calculate the angle to/between the points at the centre to have the remaining arguments for QPainter::drawArc().Qt Code:
To copy to clipboard, switch view to plain text mode
Last edited by ChrisW67; 11th July 2009 at 04:33.
Bookmarks