Is there a way to emulate UseLayoutRounding in WPF with .Net 3.5
Asked Answered
T

2

6

For installation reasons, I'd like to use 3.5 in my application. The only feature that I would be lacking is UseLayoutRounding, which worked very nicely with my custom controls. Is there a way to emulate UseLayoutRounding in 3.5?

Teter answered 1/1, 2011 at 14:53 Comment(0)
M
1

In case someone still need a workaround, here's the link, look for the Thomas Levesque comment: http://tech.pro/tutorial/1062/wpfs-most-important-property-uselayoutrounding

We had a similar issue at work in a WPF 3.5 project, and eventually we solved it by setting RenderOptions.BitmapScalingMode to NearestNeighbor and displaying the images in their original size (Stretch=None)

<Image Source="/namespace;component/Resources/image.png" Stretch="None" RenderOptions.BitmapScalingMode="NearestNeighbor"/>

This would not solve problems with DPI on different systems though.

Malcom answered 17/3, 2015 at 10:23 Comment(0)
S
0

Depending on your exact requirements, SnapsToDevicePixels="true" may be sufficient.

Sternutation answered 1/1, 2011 at 15:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.