Search code examples
c++visual-c++drawinggdi+layered-windows

Colored border of the transparent color key around text written on the transparent window


I created a Transparent Layered window with a color key that I use to make the window transparent. So far it works all fine. Writing text on it - using GDI+ - works, too...

The problem I encounter is, that the text has a thin border of the colorkey-color around the letters...

What I do in the WM_PAINT is:

1. Clear the drawing area Graphics::Clear(ColorKey);
2. Draw the text on it.

Screenshot of what i mean: http://imageshack.us/photo/my-images/709/cutp.jpg/

Anyone knows about how to avoid this?


Solution

  • Try calling Graphics::SetTextRenderingHint(TextRenderingHintSingleBitPerPixelGridFit).