News:

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

Displaying user messages on top of bitmapped graphic

Started by Don57, October 20, 2011, 07:58:17 PM

Previous topic - Next topic

Don57

Still refining my encrypt program and I wish to display text on top of bitmapped graphics. I am trying to do this by leaving the graphics intact, and having just the text displayed. Any suggestions.

dedndave

you can use a "hollow" or "null" brush as the background color when you paint the text
        INVOKE  GetStockObject,NULL_BRUSH
        INVOKE  SetBkColor,hDC,eax


or, you can use SetBkMode to set the background mode to transparent
        INVOKE  SetBkMode,hDC,TRANSPARENT

the first method is more flexible - you may want your paint routine to use various brushes
the second method is simpler, of course

dedndave

oh - there is one other method....

when you register the window class, use a value of NULL (0) for the hbrBackground member of the WNDCLASSEX structure
this is essentially the same as using a null brush

when you do this, you will be responsible for filling (erasing) the background

baltoro

TextOut function
What I usually do, is invoke all my graphic display functions in a code block, and then call InvalidateRect and UpdateWindow
See, also, Invalidating the Client Area
Baltoro