Coffeehouse Thread

29 posts

WPF Windows Apps - Bad Graphics Quality

Back to Forum: Coffeehouse
  • User profile image
    darklotus

    I am venturing into the world of WPF and have followed a few tutorials before making myself a template for the basics. I created a basic windows application and added a menu with a few menuitems and also a statusbar with a statusbaritem. All worked out very well and it all functioned correctly. However, it looks really bad. The text doesnt look right, almost like the font is pixelated or bleeding into its background. I have not created any styles so its basic text and so on.  Is there something i am missing in the markup that makes things look better? I have tried this on a few machines and they all look the same. I am not using an IDE at this time since everything is still in beta and my work machine cant afford to have beta stuff on it. Is there something i need in the csproj file to make it look better or is this just how it is?
    Thanks,
    -DL

  • User profile image
    Jack Poison

    Do you have the XAML handy? See if this can be reproduced?

  • User profile image
    StevieLINQ

    Expression Blend is not in Beta.  It is now fully released.

  • User profile image
    Sven Groot

    I believe this is caused by WPF's sub-pixel positioning. WPF uses a newer version of ClearType which is capable of positioning glyphs "in between" pixels. This improves glyph positioning, but at the expense of glyph uniformity. It can also cause glyphs that do not line up with a pixel to appear blurry.

    How to solve this, I don't know I'm afraid.

  • User profile image
    AndyC

    You could try setting SnapToDevicePixels to true, which sometimes helps. Also, make sure your system has ClearType turned on as that can improve WPF font rendering substantially.

  • User profile image
    erik_

    I dunno if this is still the case in the final version, but when I was playing around with blend I noticed that when applying some effects to elements it would transform the elements to pixel images instead of vector images.

  • User profile image
    figuerres

    darklotus wrote:
    I am venturing into the world of WPF and have followed a few tutorials before making myself a template for the basics. I created a basic windows application and added a menu with a few menuitems and also a statusbar with a statusbaritem. All worked out very well and it all functioned correctly. However, it looks really bad. The text doesnt look right, almost like the font is pixelated or bleeding into its background. I have not created any styles so its basic text and so on.  Is there something i am missing in the markup that makes things look better? I have tried this on a few machines and they all look the same. I am not using an IDE at this time since everything is still in beta and my work machine cant afford to have beta stuff on it. Is there something i need in the csproj file to make it look better or is this just how it is?
    Thanks,
    -DL


    I think you should say more about the runtime environment also...

    for example on each pc you are trying list:

    OS: XP / Vista Basic / Vista Areo Glass ?

    Display:  Tech and res; Like CRT @ 1600x1200 or LCD @ 1650x1050
    or what ever...

    Gfx Card and Driver:   doe the Gfx card suppprt Direct X9 ?
    what chipset? is it PCIx / onboard etc...

    is cleartype enabled?

    do you have a WPF app that runs on that same machine that "looks right" ?

    perhaps a sample app we can all run to compare with?
    and a sample of your code that we can look at?

    I am also looking at starting to use WPF and have many questions.

  • User profile image
    Royal​Schrubber

    darklotus, do you use XP or Vista?

    I have the same problem with Family.Show on XP. Family.Show was built as an example application, its source is available.
    On Vista it renders perfectly however on XP edges are not painted correctly. It's really annoying.

    Anyone else has troubles on XP? Is this known problem?

  • User profile image
    pvandijk28

    Iti is specifically Ellipses being rendered ugly.
    I am running XP SP2 on a Dell Precision M70.
    Is it possible to upload screenshot/images here...so you can have a look?

  • User profile image
    Rossj

    RoyalSchrubber wrote:
    
    Anyone else has troubles on XP? Is this known problem?


    Whilst I would probably have been one of the first people to moan if they hadn't, I now really do think that releasing WPF on XP was a mistake.

  • User profile image
    rhm

    AndyC wrote:
    You could try setting SnapToDevicePixels to true, which sometimes helps. Also, make sure your system has ClearType turned on as that can improve WPF font rendering substantially.


    Just to echo that....

    If you don't use ClearType (either because you don't like it or because you are using a CRT monitor) you will find that WPF by default uses a 'fuzzy' anti-aliasing algorithm like Adobe Reader does. You can either enable ClearType (if possible), or tell WPF not to anti-alias at all.

  • User profile image
    Soviut

    rhm wrote:
    
    AndyC wrote:
    You could try setting SnapToDevicePixels to true, which sometimes helps. Also, make sure your system has ClearType turned on as that can improve WPF font rendering substantially.


    Just to echo that....

    If you don't use ClearType (either because you don't like it or because you are using a CRT monitor) you will find that WPF by default uses a 'fuzzy' anti-aliasing algorithm like Adobe Reader does. You can either enable ClearType (if possible), or tell WPF not to anti-alias at all.


    ClearType anti-aliasing performs some basic pixel snapping on the fonts and uses different colours from the actual font to blend it with the background.  Even on CRTs this produces smooth fonts that stay sharp.  Adobe Reader, Mac OS and the Safari browser (as some examples) simple use a 2x or 4x anti-aliasing.  This means that letters like "U" may appear sharp on the left side and fuzzy on the right, depending on font size.

    An interesting thing I remember from some of the older versions of Flash was that if ClearType was on, Flash would double-anti-alias the text, because its internal AA was being applied as well, making it incredibly slow to edit text.

  • User profile image
    esoteric

    Adobe bought Macromedia, which recently made a sub-pixel rendering algorithm of supposedly good quality.

  • User profile image
    PaoloM

    Dylan C wrote:
    Stick with Windows Forms my friend!

    Please do not troll. Either contribute to the thread or do not post in it, thanks.

  • User profile image
    prencher

    Soviut wrote:
    
    rhm wrote:
    
    AndyC wrote:
    You could try setting SnapToDevicePixels to true, which sometimes helps. Also, make sure your system has ClearType turned on as that can improve WPF font rendering substantially.


    Just to echo that....

    If you don't use ClearType (either because you don't like it or because you are using a CRT monitor) you will find that WPF by default uses a 'fuzzy' anti-aliasing algorithm like Adobe Reader does. You can either enable ClearType (if possible), or tell WPF not to anti-alias at all.


    ClearType anti-aliasing performs some basic pixel snapping on the fonts and uses different colours from the actual font to blend it with the background.  Even on CRTs this produces smooth fonts that stay sharp.  Adobe Reader, Mac OS and the Safari browser (as some examples) simple use a 2x or 4x anti-aliasing.  This means that letters like "U" may appear sharp on the left side and fuzzy on the right, depending on font size.

    An interesting thing I remember from some of the older versions of Flash was that if ClearType was on, Flash would double-anti-alias the text, because its internal AA was being applied as well, making it incredibly slow to edit text.


    I'm sorry but that's bollocks. ClearType most certainly does NOT look "smooth and sharp" on CRT's. It looks blurry. The font itself might look slightly better (arguably), but it still remains blurry.

    Unless you are refering to vista's updated cleartype? I've not seen that on a CRT as yet.

    Interestingly, the font AA in X11 (freetype, cairo, or something else rendering the text? I'm not sure) looks a lot better than XP's "standard" font smoothing on CRT, and better than cleartype on an LCD; Not
    trolling here, just wondering if anybody know what they do differently.

    Quite a few games have excellent fonts that look very good on both LCD and CRT as well; But I suspect thats simple AA and due to the large font sizes used in most games.

  • User profile image
    TommyCarlier

    I have to admit that Dylan does have a point. Windows Forms is a mature technology that works. Our company has checked out WPF and we've concluded that we will stick with Windows Forms and GDI+ for a while. We have years of experience with it, we know what it can and can't do, we know how to make it perform well and look pretty enough, even with some modest animations (subtle fading effects). It's more than good enough for most business applications.

  • User profile image
    TommyCarlier

    Sorry Dylan, but that's were I disagree. I don't think WPF will die. It is the next generation in the evolution of Windows UI programming models. It just needs to mature, it needs to get bug fixes, optimizations and performance enhancements. And it needs developers that want to use it and push it to the limits.

  • User profile image
    JohnAskew

    I believe that Vista and WPF will assimilate all, Dylan. You're fired. :O

    Truly, I was against Win3.1 and for DOS for a few months before I got used to it. I say same is true for Dylan for XP and Vista, Winforms and WPF...

    Remember, chickens devolve into dinosaurs; don't be a dinosaur coder.

    EDIT: QFT, Tommy, plus "it needs better tools"...

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.