On Wed, Feb 8, 2012 at 7:39 AM, Sven Barth <[email protected]> wrote: > Am 08.02.2012 01:07, schrieb [email protected]: >> >> Hi, >> >> >> I'm drawing a bitmap to the canvas by using LoadFromRawImage in >> combination with a TImage. The OnPaint code below works just fine. When >> >> I move the scrollbar, the images are drawn to the canvas, however there >> is still a bit of flicker. >> >> procedure TForm1.Image1Paint(Sender: TObject); >> begin >> >> Image1.Picture.Bitmap.LoadFromRawImage(bitmaplist[ScrollBar1.Position].RawImage, >> False); >> >> >> Application.ProcessMessages; >> end; >> > > Why are you calling "Application.ProcessMessages" here? > > Regards, > Sven >
Good catch. I guess the OP has used this previously to repaint controls/images during a long-running procedure... (and even there it's often not the best solution) @dhlblaszyk: when you want to force the repaint of the whole control, call Image1.Repaint. If you want to just repaint some invalidated part of it, call Image1.Update (not sure TGraphicControl has Update, so you may need to use Parent.Update instead). Of course you should do this *outside* the OnPaint. Also, is Image1.Transparent set to false? BTW what do you mean by "The images are streamed continuously from disk"? Regards, Flávio -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
