UseLayoutRounding and Snapstodevicepixels of WPF

Source: Internet
Author: User

Recently, when I looked at other friends ' XML code at work, I found the Snapstodevicepixels property and then queried the data to understand its role.

1) userlayoutrounding is false, causing the control layout to not be rounded relative to the screen if it is not an integer, resulting in blurred edges.

2) Snapstodevicepixels default to False, true to allow element pixel-level alignment.

uielement.uselayoutrounding Property

Gets or sets a value that determines whether the rendering of the object and its visual subtree should use rounding behavior that will render to the whole pixel alignment.

(typically set on a container element, which occurs during measure&arrange)

Uielement.snapstodevicepixelsProperties

Gets or sets a value that determines whether device-specific pixel settings should be used during the rendering of an element. This is a dependency property.

(typically set in root element, occurs in render, not container element)

(DPI, Dot per inch, 96dpi:1 logical inch = pixels, PNG, etc. picture art may be set to 72dpi) For details, see Msdn:http://msdn.microsoft.com/zh-cn/library/system.windows.uielement.uselayoutrounding (v=vs.95). aspx http ://msdn.microsoft.com/zh-cn/library/vstudio/system.windows.uielement.snapstodevicepixels.aspx This article was reproduced in : http://blog.csdn.net/muzizongheng/article/details/14163227

UseLayoutRounding and Snapstodevicepixels of WPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.