Board index » delphi » drawing lines and circles

drawing lines and circles


2005-01-22 10:31:11 PM
delphi43
How do I draw a simple line or circle on a form? In Visual Basic it was
done with a "pen" object...what is the equivalent in Delphi 6?
thanks
 
 

Re:drawing lines and circles

At it is simplest, implment a FormPaint handler:
procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Brush.Color := clWhite;
Canvas.Pen.Color := clBlack;
Canvas.Ellipse(ClientRect);
Canvas.MoveTo(ClientWidth div 2, 0);
Canvas.LineTo(0, 0);
end;