Recent

Author Topic: Autoredraw  (Read 5466 times)

aspi

  • New member
  • *
  • Posts: 5
Autoredraw
« on: April 09, 2004, 08:19:51 pm »
Hi!

I've just tried to draw a "persistent" line on a canvas: Form1.Canvas.Line(x1,y1,x2,y2)
The line appeared as expected, but if I move another window over it, the line is deleted where the   window was. So I activated the autoredraw property of the canvas: Form1.Canvas.AutoRedraw := True. At runtime I've checked it's state: autoredraw is true, but it doesn't work!?

Can anybody help me?

Aspi

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Autoredraw
« Reply #1 on: April 09, 2004, 09:58:30 pm »
I don't know if the autoredraw property is supported.

What you can do is, use the OnPaint event and do the drawing there. I have succesfully created a test app, with a PiantBox where I did my drawing in the OnPaint event. You might want to try, if you can use the OnPaint event of the form.

HTH,
Vincent.

aspi

  • New member
  • *
  • Posts: 5
Works fine
« Reply #2 on: April 10, 2004, 07:56:40 pm »
Thanks Vincent, your idea works fine. I've wrote a little manager that helps me in the 'OnPaint' event to know, what lines (or other objects) need to be drawn.

All right, up to the next messages...

 

TinyPortal © 2005-2018