The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.UseLayoutRounding Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public bool UseLayoutRounding { get; set; }

Property Value

Type: System.Boolean
true if rendering and layout should use layout rounding to whole pixels; otherwise, false. The default is true.

Dependency property identifier field: UseLayoutRoundingProperty

The default of true will cause measurement and layout operations to round potential subpixel values, and render objects aligned to pixel boundaries. This behavior is intended to reduce the visual artifacts that can be perceived when a subpixel value renders and affects pixels on either side of the subpixel boundary. The most prominent example of such an artifact is when you intend to produce a crisp, thin line of a particular color. If your measurement for line gave a subpixel value, and the layout behavior did not round to whole pixels, then the line can potentially appear blurry as well as appearing as a dimmer color shade than you intended.

Setting UseLayoutRounding to false is not generally recommended, and possible scenarios for doing so are not documented here. Ultimately, if you feel that there might be benefit in enabling subpixel rendering for your application, experiment with setting UseLayoutRounding to false, examine the visual results, and make sure that possible rendering artifacts from subpixel rendering do not outweigh the perceived benefits. If you do set UseLayoutRounding to false, always do so on the root of your XAML page or object tree.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone