WPF 3.5 SP1 to fix blurry text and images

Although it is possible to display text, bitmaps, and other images in WPF you may soon realise that your display output is blurry and it is difficult for end users to use your application when a large amount of text is displayed.

 The reason for this is pixelsnapping.  Read more about this feature here: http://msdn.microsoft.com/en-us/library/aa970908.aspx .  The problem with blurry images and text is actually a WPF Design issue.  However, there is a solution coming out pretty soon; Microsoft is adding Nearest Neighbor image resampling in WPF 3.5 SP1 which will keep images from getting blurry;  they will instead get pixellated. In the mean time you could just use really large images with the default (Fant) image scaling mode so that even when magnified you would never be mapping a single texel to multiple pixels. This is what Microsoft does in Blend in several cases (like the splash screen for example) to prevent blurring with high DPI settings – they use a single large 192 DPI image which is acceptable enough when scaling.

If you absolutely must use crisp bitmaps, there are a couple of things that you can try doing:

  1.  Always use bitmaps that are the same DPI as the device on which you’re displaying. Since you don’t know at compile time what DPI your device is, in practice this means creating at least 3 copies of every bitmap: one for 96 DPI (the most common today), one for 120 DPI (the up-and-coming standard), and one for 144 DPI (common on some laptops). Of course, this still doesn’t handle every case: users are free to set whatever DPI they like on their machine and bitmaps might still look blurry in accessibility scenarios as well. You also have the problem of determining what the device DPI is in the first place – something that may not be possible in certain scenarios (e.g. Partial Trust).
  2. Ensure that the bitmap is placed an integral number of pixels from the top-left-hand corner of the device. This one is more difficult. If all your elements are fixed-layout (e.g. Canvases), you can precisely position your content relative to the window (and in V1 windows are always pixel-aligned). If you make use of any of the more complicated layout elements (Grids, DockPanels, FlowDocuments, or the like), though, you must walk up the visual tree to calculate your offset from the window origin, and you have to do this every time layout changes (for instance, every time the user scrolls through the document). 
     

Until this patch gets shipped, you may be interested in a few of these related blog posts:

-          http://blogs.msdn.com/seema/archive/2006/10/31/on-some-monitors-it-seems-that-thin-wpf-lines-are-blurred-across-two-pixels-instead-of-one-ick-how-do-i-get-sharply-rendered-lines.aspx

-          http://blogs.msdn.com/dwayneneed/archive/2007/10/05/blurry-bitmaps.aspx

SRZ080415000312

Published 07 May 2008 12:23 AM by makerofthings

Comments

# Actipro said on 15 May, 2008 12:49 PM

We've just added a PixelSnapper decorator to our WPF shared library, which helps with pixel alignment by providing options for rounding off decimal measurements of child content to integer numbers instead of decimals.  Using the PixelSnapper decorator is an easy way to keep everything crisp and clear in your WPF applications.

More info is here:

blog.actiprosoftware.com/.../How-to-prevent-blurry-images-and-lines-in-WPF.aspx

This relates directly with your second point of keeping everything an integral number of pixels from the top-left of the device.

# John Williams ok said on 20 August, 2008 07:27 AM

Pretty nice site, wants to see much more on it! :)

# Barbrartyrgreg said on 07 September, 2008 06:32 AM

garmin nuvi mp3 sd  <a href= mp3maker.org/.../burton-cummings >Burton Cummings Mp3 free songs & full albums</a>   pic of philadelphia eagles

# TTpistoleTT said on 10 September, 2008 06:24 AM

uk work permit visa 20  <a href= usaquotes.us/home-equity-loan.html >madison business centers </a> finance companies north carolina  

application debt consolidation  <a href=usaquotes.us/.../apply.html>mortgage lending washington state </a> leaders credit union

# cradyroiciake said on 23 September, 2008 07:12 AM

How i may contact the administrator of a site? I have a question.

# sombimise said on 01 October, 2008 09:04 PM

How i may contact admin this site? I have a question.

iijiivei

# effonsowl said on 19 October, 2008 08:46 AM

aztec and hard money loan <a href=usaquotes.us/.../>cityscape mortgage in hawthorne</a> majestic mortgage usaquotes.us/.../renter-insurance-info.html honda finance

# Tramadol_pyncappedge said on 26 October, 2008 09:26 AM

Your Web Site is really wonderful and I bookmarked it. Thank your for the hard work you must have put in to create this wonderful facility. Keep up the excellent work!

# Tramadol_spawvatewapag said on 26 October, 2008 07:17 PM

Your Web Site is really wonderful and I bookmarked it. Thank your for the hard work you must have put in to create this wonderful facility. Keep up the excellent work!

# kxqm wkinojrg said on 11 November, 2008 01:51 AM

mnakquo flcd tqby gsyxp tjifoabcw ohgnkcte yzfv

# tabpaiday said on 14 November, 2008 10:02 PM

to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my emai: stop.spam.today@gmail.com

And I will remove your site from my base within 24 hours

webmastegz

# Pharm32 said on 16 November, 2008 11:37 AM

Very nice site!

[url=training.cvc4.org/.../2.html]cheap cialis[/url]

# Pharm71 said on 16 November, 2008 11:37 AM

Very nice site!

[LINK training.cvc4.org/.../3.html]cheap tramadol[/LINK]

# Pharm12 said on 16 November, 2008 11:37 AM

Very nice site!

training.cvc4.org/.../4.html

# Pharm10 said on 16 November, 2008 11:37 AM

Very nice site!

# Pharm46 said on 16 November, 2008 11:37 AM

Very nice site!

[url=training.cvc4.org/.../2.html]cheap cialis[/url]

# Pharm6 said on 16 November, 2008 11:37 AM

Very nice site!

[LINK training.cvc4.org/.../3.html]cheap tramadol[/LINK]

# Pharm54 said on 16 November, 2008 11:37 AM

Very nice site!

training.cvc4.org/.../4.html

# Pharm45 said on 16 November, 2008 11:37 AM

Very nice site!

# ceritraineE said on 17 November, 2008 08:11 AM

to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my emai: stop.web.spam@gmail.com

And I will remove your site from my base within 24 hours

webmastegz

PS. As the previous address of an e-mail has been removed also all letters on it have been lost I is compelled to make this dispatch once again.

PS2. To send url your site on an e-mail stop.web.spam@gmail.com is a unique way to avoid a spam from me. To write abuses to the various "stop spam" sites - it is useless.

PS3. Your addresses of an e-mail are not necessary to me, you can create an e-mail through free service and send me yours url through this e-mail

PS4. sorry for my bad English :)

# xanax said on 17 November, 2008 04:29 PM

I bookmarked this guestbook. Thank you for good job!

# phentermine said on 17 November, 2008 04:29 PM

Excellent site. It was pleasant to me.

# cialis said on 17 November, 2008 04:29 PM

Great .Now i can say thank you!

# tramadol said on 17 November, 2008 04:29 PM

Incredible site!

# phentermine said on 17 November, 2008 04:33 PM

Excellent site. It was pleasant to me.

# xanax said on 17 November, 2008 04:33 PM

I want to say - thank you for this!

# cialis said on 17 November, 2008 04:33 PM

Great site. Good info

# tramadol said on 17 November, 2008 04:33 PM

Beautiful site!

# phentermine said on 17 November, 2008 06:04 PM

Great site. Good info

# xanax said on 17 November, 2008 06:04 PM

Great site. Good info

# cialis said on 17 November, 2008 06:04 PM

Nice site! Thank you!

# tramadol said on 17 November, 2008 06:04 PM

I want to say - thank you for this!

# xanax said on 17 November, 2008 06:38 PM

Great work,webmaster,nice design!

# phentermine said on 17 November, 2008 06:38 PM

It is the coolest site,keep so!

# cialis said on 17 November, 2008 06:38 PM

Nice site! Thank you!

# tramadol said on 17 November, 2008 06:38 PM

Beautiful site!

# phentermine said on 17 November, 2008 07:30 PM

Great work,webmaster,nice design!

# xanax said on 17 November, 2008 07:30 PM

Beautiful site!

# cialis said on 17 November, 2008 07:30 PM

Excellent site. It was pleasant to me.

# tramadol said on 17 November, 2008 07:30 PM

Great work,webmaster,nice design!

# xanax said on 17 November, 2008 07:40 PM

Perfect work!

# phentermine said on 17 November, 2008 07:40 PM

Incredible site!

# cialis said on 17 November, 2008 07:41 PM

Perfect site, i like it!

# tramadol said on 17 November, 2008 07:41 PM

Incredible site!

# xanax said on 17 November, 2008 08:44 PM

If you have to do it, you might as well do it right

# phentermine said on 17 November, 2008 08:44 PM

Great .Now i can say thank you!

# cialis said on 17 November, 2008 08:44 PM

Great site. Good info

# tramadol said on 17 November, 2008 08:44 PM

Great work,webmaster,nice design!

# phentermine said on 17 November, 2008 08:57 PM

Great .Now i can say thank you!

# xanax said on 17 November, 2008 08:57 PM

Incredible site!

# cialis said on 17 November, 2008 08:57 PM

Great .Now i can say thank you!

# tramadol said on 17 November, 2008 08:57 PM

Nice site! Thank you!

# xanax said on 17 November, 2008 09:48 PM

Excellent site. It was pleasant to me.

# phentermine said on 17 November, 2008 09:48 PM

Perfect work!

# cialis said on 17 November, 2008 09:48 PM

Excellent site. It was pleasant to me.

# tramadol said on 17 November, 2008 09:48 PM

It is the coolest site,keep so!

# phentermine said on 17 November, 2008 10:24 PM

Great site. Good info

# xanax said on 17 November, 2008 10:24 PM

It is the coolest site,keep so!

# cialis said on 17 November, 2008 10:24 PM

If you have to do it, you might as well do it right

# tramadol said on 17 November, 2008 10:24 PM

Incredible site!

# xanax said on 17 November, 2008 10:51 PM

Perfect work!

# phentermine said on 17 November, 2008 10:51 PM

Nice site! Thank you!

# cialis said on 17 November, 2008 10:51 PM

Incredible site!

# phentermine said on 17 November, 2008 11:51 PM

Great work,webmaster,nice design!

# xanax said on 17 November, 2008 11:51 PM

If you have to do it, you might as well do it right

# cialis said on 17 November, 2008 11:51 PM

Great site. Good info

# tramadol said on 17 November, 2008 11:51 PM

Perfect site, i like it!

# xanax said on 17 November, 2008 11:52 PM

Beautiful site!

# cialis said on 17 November, 2008 11:52 PM

I want to say - thank you for this!

# tramadol said on 17 November, 2008 11:52 PM

Excellent site. It was pleasant to me.

# xanax said on 18 November, 2008 12:54 AM

Great work,webmaster,nice design!

# phentermine said on 18 November, 2008 12:54 AM

I want to say - thank you for this!

# cialis said on 18 November, 2008 12:54 AM

Very interesting site. Hope it will always be alive!

# tramadol said on 18 November, 2008 12:54 AM

Beautiful site!

# xanax said on 18 November, 2008 01:18 AM

Great .Now i can say thank you!

# cialis said on 18 November, 2008 01:18 AM

Excellent site. It was pleasant to me.

# tramadol said on 18 November, 2008 01:18 AM

I bookmarked this guestbook. Thank you for good job!

# phentermine said on 18 November, 2008 01:56 AM

Incredible site!

# cialis said on 18 November, 2008 01:56 AM

Great site. Keep doing.

# tramadol said on 18 November, 2008 01:56 AM

Nice site! Thank you!

# phentermine said on 18 November, 2008 02:46 AM

If you have to do it, you might as well do it right

# xanax said on 18 November, 2008 02:46 AM

I bookmarked this guestbook. Thank you for good job!

# cialis said on 18 November, 2008 02:46 AM

Perfect work!

# tramadol said on 18 November, 2008 02:46 AM

Great .Now i can say thank you!

# xanax said on 18 November, 2008 02:58 AM

Perfect work!

# phentermine said on 18 November, 2008 02:58 AM

Beautiful site!

# cialis said on 18 November, 2008 02:58 AM

Great .Now i can say thank you!

# tramadol said on 18 November, 2008 02:58 AM

Great .Now i can say thank you!

# xanax said on 18 November, 2008 04:02 AM

Great site. Good info

# phentermine said on 18 November, 2008 04:02 AM

I bookmarked this guestbook. Thank you for good job!

# cialis said on 18 November, 2008 04:02 AM

Beautiful site!

# tramadol said on 18 November, 2008 04:02 AM

Incredible site!

# xanax said on 18 November, 2008 04:14 AM

Great site. Good info

# cialis said on 18 November, 2008 04:14 AM

Nice site! Thank you!

# tramadol said on 18 November, 2008 04:14 AM

It is the coolest site,keep so!

# xanax said on 18 November, 2008 05:05 AM

Incredible site!

# phentermine said on 18 November, 2008 05:05 AM

Incredible site!

# cialis said on 18 November, 2008 05:05 AM

I want to say - thank you for this!

# tramadol said on 18 November, 2008 05:05 AM

Excellent site. It was pleasant to me.

# phentermine said on 18 November, 2008 05:42 AM

Perfect work!

# xanax said on 18 November, 2008 05:42 AM

Excellent site. It was pleasant to me.

# cialis said on 18 November, 2008 05:42 AM

Perfect site, i like it!

# tramadol said on 18 November, 2008 05:42 AM

Perfect site, i like it!

# xanax said on 18 November, 2008 06:07 AM

Perfect work!

# phentermine said on 18 November, 2008 06:07 AM

I want to say - thank you for this!

# levitra said on 18 November, 2008 06:25 AM

It is the coolest site,keep so!

# cialis said on 18 November, 2008 06:25 AM

Nice site! Thank you!

# phentermine said on 18 November, 2008 06:25 AM

Great .Now i can say thank you!

# tramadol said on 18 November, 2008 06:26 AM

I want to say - thank you for this!

# xanax said on 18 November, 2008 07:10 AM

Perfect site, i like it!

# phentermine said on 18 November, 2008 07:10 AM

Perfect site, i like it!

# cialis said on 18 November, 2008 07:10 AM

Great .Now i can say thank you!

# tramadol said on 18 November, 2008 07:10 AM

It is the coolest site,keep so!

# phentermine said on 18 November, 2008 07:10 AM

Perfect site, i like it!

# xanax said on 18 November, 2008 07:11 AM

Great .Now i can say thank you!

# cialis said on 18 November, 2008 07:11 AM

If you have to do it, you might as well do it right

# tramadol said on 18 November, 2008 07:11 AM

Incredible site!

# xanax said on 18 November, 2008 08:14 AM

Beautiful site!

# phentermine said on 18 November, 2008 08:14 AM

Incredible site!

# cialis said on 18 November, 2008 08:14 AM

Beautiful site!

# tramadol said on 18 November, 2008 08:14 AM

I bookmarked this guestbook. Thank you for good job!

# levitra said on 18 November, 2008 08:39 AM

It is the coolest site,keep so!

# cialis said on 18 November, 2008 08:39 AM

Very interesting site. Hope it will always be alive!

# phentermine said on 18 November, 2008 08:39 AM

Incredible site!

# tramadol said on 18 November, 2008 08:39 AM

I want to say - thank you for this!

# phentermine said on 18 November, 2008 08:40 AM

I want to say - thank you for this!

# xanax said on 18 November, 2008 08:40 AM

It is the coolest site,keep so!

# cialis said on 18 November, 2008 08:40 AM

I bookmarked this guestbook. Thank you for good job!

# tramadol said on 18 November, 2008 08:40 AM

Very interesting site. Hope it will always be alive!

# xanax said on 18 November, 2008 09:18 AM

Great .Now i can say thank you!

# phentermine said on 18 November, 2008 09:18 AM

Beautiful site!

# cialis said on 18 November, 2008 09:18 AM

Nice site! Thank you!

# tramadol said on 18 November, 2008 09:18 AM

Perfect site, i like it!

# levitra said on 18 November, 2008 09:51 AM

Perfect work!

# cialis said on 18 November, 2008 09:51 AM

Excellent site. It was pleasant to me.

# phentermine said on 18 November, 2008 09:51 AM

Very interesting site. Hope it will always be alive!

# tramadol said on 18 November, 2008 09:51 AM

Nice site! Thank you!

# phentermine said on 18 November, 2008 10:08 AM

Great site. Keep doing.

# xanax said on 18 November, 2008 10:08 AM

I want to say - thank you for this!

# cialis said on 18 November, 2008 10:08 AM

Perfect work!

# tramadol said on 18 November, 2008 10:08 AM

Great work,webmaster,nice design!

# xanax said on 18 November, 2008 10:23 AM

If you have to do it, you might as well do it right

# phentermine said on 18 November, 2008 10:23 AM

Great work,webmaster,nice design!

# cialis said on 18 November, 2008 10:23 AM

Great .Now i can say thank you!

# tramadol said on 18 November, 2008 10:23 AM

Great site. Good info

# levitra said on 18 November, 2008 10:59 AM

I want to say - thank you for this!

# cialis said on 18 November, 2008 10:59 AM

If you have to do it, you might as well do it right

# phentermine said on 18 November, 2008 10:59 AM

Nice site! Thank you!

# tramadol said on 18 November, 2008 11:00 AM

Great site. Good info

# xanax said on 18 November, 2008 11:26 AM

It is the coolest site,keep so!

# phentermine said on 18 November, 2008 11:26 AM

Nice site! Thank you!

# cialis said on 18 November, 2008 11:26 AM

Excellent site. It was pleasant to me.

# tramadol said on 18 November, 2008 11:26 AM

Beautiful site!

# phentermine said on 18 November, 2008 11:37 AM

Great .Now i can say thank you!

# xanax said on 18 November, 2008 11:37 AM

Perfect work!

# cialis said on 18 November, 2008 11:37 AM

Great site. Good info

# tramadol said on 18 November, 2008 11:37 AM

Beautiful site!

# cialis said on 18 November, 2008 12:07 PM

Perfect work!

# phentermine said on 18 November, 2008 12:07 PM

I bookmarked this guestbook. Thank you for good job!

# tramadol said on 18 November, 2008 12:07 PM

Perfect work!

# xanax said on 18 November, 2008 12:34 PM

Excellent site. It was pleasant to me.

# phentermine said on 18 November, 2008 12:34 PM

Great site. Keep doing.

# cialis said on 18 November, 2008 12:34 PM

I want to say - thank you for this!

# tramadol said on 18 November, 2008 12:35 PM

Great site. Keep doing.

# phentermine said on 18 November, 2008 01:03 PM

Great work,webmaster,nice design!

# xanax said on 18 November, 2008 01:03 PM

Great site. Good info

# cialis said on 18 November, 2008 01:03 PM

If you have to do it, you might as well do it right

# tramadol said on 18 November, 2008 01:03 PM

Perfect site, i like it!

# levitra said on 18 November, 2008 01:15 PM

Nice site! Thank you!

# cialis said on 18 November, 2008 01:15 PM

I bookmarked this guestbook. Thank you for good job!

# phentermine said on 18 November, 2008 01:15 PM

If you have to do it, you might as well do it right

# tramadol said on 18 November, 2008 01:15 PM

Beautiful site!

# xanax said on 18 November, 2008 01:44 PM

Perfect site, i like it!

# phentermine said on 18 November, 2008 01:44 PM

Excellent site. It was pleasant to me.

# cialis said on 18 November, 2008 01:44 PM

Great .Now i can say thank you!

# tramadol said on 18 November, 2008 01:44 PM

Beautiful site!

# levitra said on 18 November, 2008 02:24 PM

Beautiful site!

# cialis said on 18 November, 2008 02:24 PM

It is the coolest site,keep so!

# phentermine said on 18 November, 2008 02:24 PM

Very interesting site. Hope it will always be alive!

# tramadol said on 18 November, 2008 02:24 PM

It is the coolest site,keep so!

# phentermine said on 18 November, 2008 02:30 PM

I want to say - thank you for this!

# xanax said on 18 November, 2008 02:30 PM

Perfect work!

# cialis said on 18 November, 2008 02:30 PM

Great site. Keep doing.

# tramadol said on 18 November, 2008 02:30 PM

Perfect work!

# levitra said on 18 November, 2008 03:32 PM

Very interesting site. Hope it will always be alive!

# cialis said on 18 November, 2008 03:32 PM

Excellent site. It was pleasant to me.

# phentermine said on 18 November, 2008 03:32 PM

Perfect site, i like it!

# tramadol said on 18 November, 2008 03:32 PM

Great .Now i can say thank you!

# phentermine said on 18 November, 2008 03:57 PM

Very interesting site. Hope it will always be alive!

# xanax said on 18 November, 2008 03:57 PM

Excellent site. It was pleasant to me.

# cialis said on 18 November, 2008 03:57 PM

It is the coolest site,keep so!

# tramadol said on 18 November, 2008 03:57 PM

I want to say - thank you for this!

# levitra said on 18 November, 2008 04:38 PM

Great site. Keep doing.

# cialis said on 18 November, 2008 04:38 PM

Nice site! Thank you!

# phentermine said on 18 November, 2008 04:38 PM

If you have to do it, you might as well do it right

# tramadol said on 18 November, 2008 04:38 PM

Very interesting site. Hope it will always be alive!

# Vardenafil said on 18 November, 2008 05:01 PM

The site very professional! Keep up the good work! Oh yes, one extra comment - maybe you could add more pictures too! So, good luck to your team!

# xanax said on 18 November, 2008 05:13 PM

Nice site! Thank you!

# phentermine said on 18 November, 2008 05:13 PM

Incredible site!

# cialis said on 18 November, 2008 05:13 PM

Perfect work!

# tramadol said on 18 November, 2008 05:14 PM

Nice site! Thank you!

# phentermine said on 18 November, 2008 05:22 PM

I want to say - thank you for this!

# xanax said on 18 November, 2008 05:22 PM

Perfect work!

# cialis said on 18 November, 2008 05:22 PM

Perfect work!

# levitra said on 18 November, 2008 05:40 PM

Great .Now i can say thank you!

# cialis said on 18 November, 2008 05:40 PM

If you have to do it, you might as well do it right

# phentermine said on 18 November, 2008 05:40 PM

Great site. Good info

# tramadol said on 18 November, 2008 05:40 PM

Excellent site. It was pleasant to me.

# xanax said on 18 November, 2008 06:17 PM

Great site. Keep doing.

# phentermine said on 18 November, 2008 06:17 PM

Great site. Keep doing.

# cialis said on 18 November, 2008 06:17 PM

Excellent site. It was pleasant to me.

# tramadol said on 18 November, 2008 06:18 PM

I bookmarked this guestbook. Thank you for good job!

# levitra said on 18 November, 2008 06:43 PM

I want to say - thank you for this!

# cialis said on 18 November, 2008 06:43 PM

Excellent site. It was pleasant to me.

# phentermine said on 18 November, 2008 06:43 PM

Great work,webmaster,nice design!

# tramadol said on 18 November, 2008 06:43 PM

Great site. Good info

# phentermine said on 18 November, 2008 06:46