Draw / print text with transparent background in C ++ win32

I am trying to draw / print text, but I need a transparent background. I tried this:

    TextOut(hDC, 50, 50, "MY TEXT", lstrlen("MY TEXT"));

The problem is that this creates a white background. I also tried with this:

    ExtTextOut(hDC, 50, 50, ETO_OPAQUE, TA_LEFT,  "MY TEXT", lstrlen("MY TEXT"), NULL);

ETO_OPAQUE - sets the background color in the text area to the current background color of the program. But if my background is dynamic and changing, this will not work, and therefore I need a transparent background.

For more information about these two functions http://msdn.microsoft.com/en-us/library/dd144821(v=vs.85)

I know that I can insert text into a bitmap and use "TransparentBlt" to achieve the "same" effect, but ... Anyone who knows another function to draw / print text with a transparent background or any ideas on how I can solve this so-called problem?

Thanks ... =)

+3
source share
1 answer
SetBkMode( hdc, TRANSPARENT );
+8
source

All Articles