Board index » delphi » HOW TO: prevent flickering during repaint ?

HOW TO: prevent flickering during repaint ?

I have lot of images and panels on form which I need to repaint in
some situations. But during repainting, annoying flickerring occurs
beacuse delhpi repaint them one by one so every one flicker a bit
which is very messy ... Is it possible to eliminate it somehow and
have visible only final result after all repainting ?

I use D3 C/S
Arminio.Gr...@USA.Net                     Pozega, Croatia
http://www.geocities.com/SiliconValley/Way/9629/arminio.htm

 

Re:HOW TO: prevent flickering during repaint ?


In article <399e69b9.14486...@news.tel.hr>, Arminio.Gr...@USA.Net said...

Quote
> I have lot of images and panels on form which I need to repaint in
> some situations. But during repainting, annoying flickerring occurs
> beacuse delhpi repaint them one by one so every one flicker a bit
> which is very messy ... Is it possible to eliminate it somehow and
> have visible only final result after all repainting ?

See help for LockWindowUpdate, although I didn't succeed in unlocking.
Also, if the window is being resized you could eliminate flicker by
catching the WM_ERASEBKGND message.

Matthijs

--
WinAmp now playing Lunachicks - Shut you out

Re:HOW TO: prevent flickering during repaint ?


Do all your image processing to a buffer then copy all over with copyrect.
eg.
var BufferBmp: TBitmap;
Begin
  BufferBmp:=TBitmap.Create;
    {Do all your image proccessing to BufferBmp}
  Form1.Canvas.CopyRect(Rect(0,0,X,Y),BufferBmp.Canvas,Rect(0,0,X,Y));
    {Where X and Y are the dimensions}
End;
Arminio Grgic - GrGa <Arminio.Gr...@USA.Net> wrote in message
news:399e69b9.14486460@news.tel.hr...
Quote
> I have lot of images and panels on form which I need to repaint in
> some situations. But during repainting, annoying flickerring occurs
> beacuse delhpi repaint them one by one so every one flicker a bit
> which is very messy ... Is it possible to eliminate it somehow and
> have visible only final result after all repainting ?

> I use D3 C/S
> Arminio.Gr...@USA.Net                     Pozega, Croatia
> http://www.geocities.com/SiliconValley/Way/9629/arminio.htm

Other Threads