Tech Off Thread

4 posts

minor annoyance with text anti-aliasing (vista vs .net)

Back to Forum: Tech Off
  • Royal​Schrubber

    This really doesn't bother me very much, but if anyone knows the reason why text is rendered differently then enlighten me please. Smiley


    So here's the crime scene:





    Magnified:




    Left button has text rendered on Paint event of that button, right button has Text property set to the same text.

    You can see there is not much difference, though I think right (vista) version of button looks slightly better.

    Code that generates .NET button looks like this:

    e.Graphics.DrawString("Infinity color", button2.Font, new SolidBrush(button2.ForeColor), x, y);

    I don't see why these two buttons don't render the same. Does Vista use newer version of anti-aliasing technology that is not available in .NET?

    (guess I'll have to go fiddle with win32 api - but I don't want to Tongue Out)

  • BorekB

    I strongly dislike WPF's text rendering (the text is much less readable in my opinion - and yes, I am on LCD) and would also like to know why
    the team didn't use system rendering. Maybe there was some good reason but from my (user's) perspective, I simply don't like it.

  • stevo_

    I think this is the cleartype vs wpf debate.. goog- I mean, 'search engine of preference' that, and you'll see tons of debate about it.

  • TommyCarlier

    The difference is not because of Vista: it's the difference between rendering using GDI or GDI+. Drawing in .NET uses GDI+. To render text using GDI, use the TextRenderer-class.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.