-
DrawText
Hello,
I loaded a bitmap into my window. Now I want to draw text on that image, but there is a white rectangle where my text is written. Is there a way to just draw letters whitout the white rectangle? If no, how can I change the color of the white rectangle? I'm using DrawTextEx to draw my text but anyother function should do.
-
There is some way to set the text background to transparent, but I forgot how.
-
Ok that's right I discovered how to do it. Just had to SetBkMode to transparent... But now I would like to know how I could change the size of the text I draw.
-
Just use CreateFont to make the font. This function will return the font which you then select into a DC.
Example:
PHP Code:
HFONT hFont = CreateFont(30, 15, 0, 0, FW_BOLD, 0, 0, 0, ANSI_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_ROMAN, "Arial" );
SelectObject(SomeDC, hFont);
You can use SetTextColor to change the font color too.
Chilibean