This seems to be trickier than one would assume. Can someons explain how to write text into a window in which I'm repeatedly writing and erasing bitmaps to do animation?

I want to write a text string into the window, then scroll a bitap accross the screen, overtop of the text. This would effectivly erase the text, leaving a blank screen, after the bitmap scrolls off the window. Most of the time the text never apperas at all, or is erased before I can see it. I only see the text if I comment out the BitBlt that draws the image for the animation.

Strangely, the window style seems to effect the behavior. If I have the property WS_EX_TOPMOST set, the program behaves differently than when that property is clear.
Posted on 2002-02-28 17:07:52 by The Worrier King
It shouldn't be too hard. You'll just have to redraw the text every frame prior to Blting the bitmap. That will ensure areas that the bitmap covered will be redrawn when the bitmap has moved on.

Of course this could all cause flickering, but there are various ways of solving that later, getting it working should be your first priority. :grin:

One other thing to consider would be putting the bitmap in a static control and moving the control around instead. That technique is used in my drag and drop tutorial.
Posted on 2002-02-28 17:25:35 by Eóin

There are a few drawbacks to rewriting the string every time. First, the scrolling bitmap won't erase the string as it passes by. Also, the text seems to flicker a bit. And finally, when the bitmap is in front of the text, the text "bleeds through" the bitmap.

Here's where I'm at so far. The goal is to make the text disappear as the image passes over it. Any ideas?
Posted on 2002-03-01 20:45:39 by The Worrier King