News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

erased drawings

Started by ofg, January 21, 2005, 10:43:20 PM

Previous topic - Next topic

ofg

hi,
I draw several polygons on a child window.
When I open another application e.g.Calculator,the portions of
the polygons blocked by the application are erased.I process
WM_PAINT message and redraw the polygons,but afterwards
when I move the Calculator along the screen my drawings
flicker.What can I do to avoid both of these problems.
thanks.

Relvinian

To erase flickering, you will need to "double-buffer" your drawing and then handle the WM_ERASEBKGRND message and just return TRUE.

To create a double buffer before actually drawing it in your WM_PAINT handler, create a bitmap the size you want to draw with and draw everything there first, then just bitblt the bitmap image onto the screen DC.

As for losing your polygons when another application window is on top, this is the correct behavior. If you want your window to ALWAYS remain on top, make sure you create your window with the WS_EX_TOPMOST style.

Relvinian

petezl

If another program is erasing your window by moving over it you will have to call InvalidateRect,hWnd,0,0 in the appropriate place.
Peter.
Cats and women do as they please
Dogs and men should realise it.

petezl

Oops! What I should have said is that it's probably an error in your code that is causing this.
InvalidateRect is only needed when you need to force a repaint.
Peter.
Cats and women do as they please
Dogs and men should realise it.

hutch--

Back bffering is the way to go as you get no flicker doing it but if you have the windows without animation and another windows overlaps it, then you can reblit the last back buffer to the display area to solve that problem.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php