How to redraw only when form resize is complete? lazarus / 31-LCL ---------------------------------------------------------------------- Windsurfer · 2015-03-10 12:24 I have a form that contains a graphic, which is created from up to 10,000 thousand data points. I have tuned the code (LCL) to run very quickly, and I am very happy with the speed in Windows and Linux. My problem is that when the form is resized, the panels and buttons in the form do not change very smoothly. Is there a way to suppress the repaints until the form resize is complete? i7 processor, Linux Mint 17, 1.4RC2, qt and GTK2. ---------------------------------------------------------------------- Martin_fr · 2015-03-10 13:50 Well I don't know. Maybe you can track the mouse down/up, and set flag, and in your paint code do a check (the point event will happen, no matter what) But I suggest a different approach. Paint your data to a bitmap, then onpaint only (stretch) draw the image. If stretch was needed, then Application.QueueAsyncCall. Or ONIdle Or ontimer. There you can redraw your data. ** EXCEPT ** do not draw all at once. Draw small bits, that take little time. And then set another Application.QueueAsyncCall and continue (or restart if further resize occurred) Or repaint in a thread. check regularly, if the current paint, still fits the size. ---------------------------------------------------------------------- Eugene Loza · 2015-03-10 14:45 Looks something similar to this: http://stackoverflow.com/questions/1454190/how-can-i-make-my-form- resize-more-smoothly and, maybe with this note: http://forum.lazarus.freepascal.org/index.php?topic=23487.0 ---------------------------------------------------------------------- Windsurfer · 2015-03-10 23:00 Thanks for the ideas. I'll post back after some tests.