> I've a short question. How do I draw a circle on my form?
> I know that a circle is a special type of ellipse, but when trying to
> draw one I set the the circle's center to let's say (100, 100).
> Anyone have an example of doing this ?
> Ronan van Riet
it depends of the way you want to draw the circle. Here is an example
for the case you have a special radius:
procedure TForm1.DrawTheCircle(Canvas: TCanvas; radius: Integer; P:
Canvas.Ellipse(P.x - radius, P.y - radius, P.x + radius, P.y +
procedure TForm1.Button1Click(Sender: TObject);
DrawTheCircle(Canvas, 30, Point(100, 100));
or if you want to use the OnMouseUp event to set the center of the
circle you can doit like this:
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
DrawTheCircle(Canvas, 30, Point(x, y));