Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should UseLayoutRounding & SnapsToDevicePixels Be Used Always?

Tags:

wpf

In my other (unrelated) question, @Meleak had SnapsToDevicePixels scattered throughout the code (in his answer), I found out it is used to make things look sharper. So the question, why is it not used everywhere since it will make things look better? OR are there downsides I need to be aware of? When should/shouldn't I use it?

like image 840
Jiew Meng Avatar asked Nov 12 '10 12:11

Jiew Meng


1 Answers

Doing that disables subpixel rendering, which improves sharpness but also defeats WPF's resolution independence. It can either be a good or a bad thing, depending on what you're doing in your app, graphics-wise.

See Pixel Snapping on MSDN for a complete explanation.

like image 133
Frédéric Hamidi Avatar answered Nov 03 '22 22:11

Frédéric Hamidi