bnz
asked on
Image.beginupdate ?
I'm doing lot of drawing on the canvas in a image, this has the bad effect that some other images on the form flickers from time to time.
Is there a way to make it more flicker free.
I thought of LockWindowUpdate but as remember this seems to make all windows flicker.
Is there a way to make it more flicker free.
I thought of LockWindowUpdate but as remember this seems to make all windows flicker.
I'm not sure how many times you are drawing on the image canvas, but since you said 'alot', you may want to try what's called page filpping. Whenever you draw directly on a visible canvas rapidly and a draw does NOT sync with the monitor's refresh rate you get some flicker. Try to not draw something on a part of a visible canvas. Only replace the ENTIRE image with a memory bitmap that you have drawn on. Flip a whole page to the image instead of a piece of a page. This may seem like a backwards way (more work instead of less) to do it, but it tends to sync together with the refresh rate better. Oh, a TImage has some update routines that may kick in. You may want to try a PaintBox or Do all the rapid drawing in a Rect on the Form's Canvas. If your drawing is not rapid, you could try DoubleBuffer := True;
I has the same problems with standard delphi components. Best solution I found it do NOT use it, if you want nice graphic application.
I use components from http://www.stuckindoors.com/dib/.
It solved most of my problems. The biggest disadvantage (for me) is that it cannot run in 256 colors mode.
I use components from http://www.stuckindoors.com/dib/.
It solved most of my problems. The biggest disadvantage (for me) is that it cannot run in 256 colors mode.
maybe it helps to place the timage on a tpanel
ASKER
Slick812: I tried to create an invisible image and then paint on the real image using this code VisibleImage.Canvas.Draw(0 ,0, TempImage);
It helps a bit but not much, am I doing the right thing?
Slavak: thanks for you tip, the component does not work with Delphi 6 yet, so I will way for that to come.
It helps a bit but not much, am I doing the right thing?
Slavak: thanks for you tip, the component does not work with Delphi 6 yet, so I will way for that to come.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ahh now I get it. You are right, I used a paintbox and 99% flicker free :)