Wed Jun 12, 2019, 04:13 AM

Any Experienced Delphi Programmers Out There??

Specifically, I need help understanding the Arc command.

Image1.Canvas.Arc(10, 10, 150, 150, 60, 60, 20, 20)

First two coordinates refer to upper left of rectangle in which the Arc appears. Coordinates three and four refer to lower right. But I CANNOT figure out what the last four numbers mean. I have experimented and experimented and experimented and I have never gotten an arc to come out looking the way I expected. Never. Not even once.

If anybody has a clue, appreciate any assistance.

2 replies, 83 views

Reply to this thread

Back to top Alert abuse

Always highlight: 10 newest replies | Replies posted after I mark a forum
Replies to this discussion thread
Arrow 2 replies Author Time Post
Reply Any Experienced Delphi Programmers Out There?? (Original post)
Bubba Wednesday OP
sipow Wednesday #1
Bubba Thursday #2

Response to Bubba (Original post)

Wed Jun 12, 2019, 06:35 AM

1. Not a Delphi programmer - but I believe this is how it works

There are four x/y coordinates given.
The first and second pairs are the top left and bottom right coordinates of a rectangle. This rectangle defines an ellipse. (Bounding box around the ellipse)

The drawn arc will be a portion of that ellipse.

The starting point is defined by the third coordinate pair. Specifically it will start where a line drawn from the center of the ellipse through the third coordinate intersects the ellipse. The ending point is done in a similar way but uses a line from the center through the fourth coordinate pair. Keep in mind that the center of the ellipse is the center of the rectangle made by the first two coordinates.

The third and fourth coordinate pairs seem like they have weird rules - but if you pick a point on your arc where it starts and another where it ends it will work.

If you did (10, 10, 150, 150, 10, 10, 150, 150) you should get half an ellipse, cut along the diagonal. Actually will be circular since width and height are equal.

(10, 10, 210, 110, 10, 55, 210, 55) will give the upper half of an ellipse.

Reply to this post

Back to top Alert abuse Link here Permalink

Response to sipow (Reply #1)

Thu Jun 13, 2019, 01:41 AM

2. Thank You. N/T

Reply to this post

Back to top Alert abuse Link here Permalink