Recent

Author Topic: Canvas.Arc function does not work  (Read 3004 times)

newman

  • Jr. Member
  • **
  • Posts: 75
Canvas.Arc function does not work
« on: October 26, 2016, 09:31:02 am »
Hi,

I am trying to get the Canvas.Arc function to draw an arc on a form, however it does not work.

I pasted the following code in the Form.OnPaint event.

Canvas.Pen.Color:= clRed;
Canvas.Pen.Width:= 1;
Canvas.Arc(106,6,139,64,139,6,139,6);

However nothing gets drawn.

I am using Lazarus 1.6 on OS X (EL Capitan).

Other functions like ArcTo, LineTo, Ellipse etc works,

Please help

thanks
nm

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Canvas.Arc function does not work
« Reply #1 on: October 26, 2016, 09:53:09 am »
To me that draws a small red circle on top.

Win10, some ages old Lazarus 1.3.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8611
  • FPC developer.
Re: Canvas.Arc function does not work
« Reply #2 on: October 26, 2016, 10:23:07 am »
Try to pain in the onpaint event.

newman

  • Jr. Member
  • **
  • Posts: 75
Re: Canvas.Arc function does not work
« Reply #3 on: October 26, 2016, 12:23:19 pm »
I created a fresh project and pasted the paint code in the OnPaint event of the form.

Quote
procedure TForm1.FormPaint(Sender: TObject);
begin
  Canvas.Pen.Color:= clRed;
Canvas.Pen.Width:= 1;
Canvas.Arc(106,6,139,64,139,6,139,6);

end;

However even now nothing is drawn on the form...

thanks
nm

newman

  • Jr. Member
  • **
  • Posts: 75
Re: Canvas.Arc function does not work
« Reply #4 on: October 26, 2016, 12:56:10 pm »
OK, now I changed some of the parameters in the arc function, I am able to draw some arcs on the screen

thanks
nm

 

TinyPortal © 2005-2018