Incorrect result with TransparentBlt

前端 未结 1 1808
我寻月下人不归
我寻月下人不归 2021-01-28 06:59

I am working on a transparent treeview control. In order to achieve transparency I have subclassed the tree and am overriding WM_PAINT ( in my WM_ERASEBKGND

相关标签:
1条回答
  • 2021-01-28 07:18

    On Windows 7 the text is smoothed with anti-aliasing. Windows doesn't paint pixels of black text on a background of solid colour, it paints a blend between black and the background colour.

    TransparentBlt treats a single solid colour as transparent. Hence it doesn't treat the antialiased edges of the text as transparent, so these edges are visible in the final bitmap.

    To fix this you could select a font with anti-aliasing disabled, but obviously this will give you more lumpy text.

    The problem on XP is that the corner of the check-boxes is the same colour as the background. You can probably fix this by changing the background to a colour that doesn't clash (e.g. magenta).

    0 讨论(0)
提交回复
热议问题