My images are blurry! Why isn't WPF's SnapsToDevicePixels working?

Posted by Zack Peterson on Stack Overflow See other posts from Stack Overflow or by Zack Peterson
Published on 2009-02-26T19:19:21Z Indexed on 2010/04/29 2:37 UTC
Read the original article Hit count: 607

Filed under:
|
|
|
|

I'm using some Images in my WPF applcation.

XAML:

<Image Name="ImageOrderedList"
       Source="images/OrderedList.png"
       ToolTip="Ordered List"
       Margin="0,0,5,5"
       Width="20"
       Height="20"
       SnapsToDevicePixels="True"
       MouseUp="Image_MouseUp"
       MouseEnter="Image_MouseEnter"
       MouseLeave="Image_MouseLeave" />

But, they appear fuzzy:

Blurry WPF Images

Here's a zoomed-in, side-by-side comparison. An original is on the left:

Blurry WPF Image Zoomed

Why doesn't that SnapsToDevicePixels="True" line prevent this problem?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml