Ideally, I'd paint all the child windows to a memory DC, then draw that DC
into the parent window. Can I achieve this in OnPaint()? What's the best
way? Ideally, I'd like to stay away from CS_OWNDC.
--
Thanks,
Brian Toothill
I, too, would avoid CS_OWNDC, especially given the fact that it won't really
help you here. In general, each window should be painted separately as
Windows tracks which ones need repainting and which ones have been
repainted. You could handle this yourself but it would make things much
harder. But I've never had a problem where painting windows separate "does
not look good."
One option is to not use real child windows. Instead, track where the window
would be and then draw them when you draw the parent window. Of course, you
would need to track any mouse actions that relate to those buttons.
Beyond that, yes, you can draw to a memory DC first and then BitBlt it to
the screen. Just create a compatible DC. However, if your DC is to the
parent window, it will not overwrite any child windows that cover it. To
accomplish this, you'd need a DC to the entire screen. This is not
necessarily recommended and I'd really think through what you are trying to
do before attempting something like that.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Brian Toothill" <.> wrote in message
news:e1XlsB8c...@TK2MSFTNGP10.phx.gbl...
The reason I want to do a one-off paint is that I'm drawing a lot of bitmaps
to represent an on-screen keyboard on a handheld device on Windows CE. When
I draw the buttons, they seem to 'sweep' across the screen as they're
drawn - this is the "not looking good" bit. If I can draw the buttons
off-screen, then do one paint (or blt) to render all of them at once, great!
I'm using MFC as well, though I don't see this being an issue.
--
Brian Toothill
"Jonathan Wood" <jw...@softcircuits.com> wrote in message
news:uG1%23289c...@TK2MSFTNGP11.phx.gbl...
Or better yet, use a single bitmap for the entire keyboard and just bitblt
that to the screen.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Brian Toothill" <brian.t...@virgin.net> wrote in message
news:uLaosMEd...@TK2MSFTNGP11.phx.gbl...