BitBlt function redraw
I am using the BitBlt function to draw images on a form and is IT working great. But when I redraw the screen it causes a flash across the screen. Is there any way of avoiding or removing this screen flashing?
Thanks.
[226 byte] By [
T-REX] at [2007-11-19 10:48:05]

# 1 Re: BitBlt function redraw
Yes, by implementing double-buffering (maybe even triple if you want). You achieve this by blitting your graphics onto a mem dc and then blitting that mem dc onto your form all at once.
The "flashing" you are seeing is because the drawing is taking place all on the "front buffer" and is just slow enuff for your eyes to detect that it isn't occuring instantaneously. With double-buffering, the drawing appears instantaneous to the eye.
Hope this helps.
Regards.
# 2 Re: BitBlt function redraw
You need to handle the WM_ERASEBKGND message so that it does nothing, or does something appropriate.
That's why you're seeing the flash : the background and foreground of a window are drawn seperately so the flash is being caused by the background being drawn over the original image, which is then drawn again by the WM_PAINT message.
Darwen.
darwen at 2007-11-10 3:51:34 >
