Anti-Aliased Text in a Transparent .NET Form

后端 未结 2 592
孤独总比滥情好
孤独总比滥情好 2021-01-02 09:44

I have a C# application which shows the current time in a transparent .NET Form. The Form has no controls and no border. Its property TransparencyKey is set to the Form\'s

2条回答
  •  -上瘾入骨i
    2021-01-02 10:08

    I asked a similar question a few months ago.

    What I ended up doing was having two options:

    1. Copy the background behind the application by setting its opacity to 0 temporarily, then draw antialiased text onto that. This approach works well if the window and those under it don't move often.
    2. Using a layered window. Works better than TransparencyKey, but still works best with non-antialiased text. (just avoid using a ClearType font and you will be fine)

提交回复
热议问题