Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any hints for dealing with snap to device pixels in WPF

Tags:

wpf

Many controls in WPF has this snap to device pixels (as explained on MSDN). I just often find myself forgetting to set it and then later discover that something sometimes looks odd because of this.

What do people use to deal with this issue?

like image 491
Anders Rune Jensen Avatar asked Feb 28 '23 11:02

Anders Rune Jensen


1 Answers

SnapsToDevicePixels property is inherited through the element tree.

I always set SnapsToDevicePixels="True" on each Window, and all the children inherit the value.

(But I don't have any suggestion for how to remember to set it on each Window.)

like image 131
Edward Avatar answered Mar 07 '23 02:03

Edward