Visual.VisualXSnappingGuidelines Property


获取或设置 x 坐标(垂直)准线集合。Gets or sets the x-coordinate (vertical) guideline collection.

public:  property System::Windows::Media::DoubleCollection ^ VisualXSnappingGuidelines {  protected public:
System::Windows::Media::DoubleCollection ^ get(); protected:
 void set(System::Windows::Media::DoubleCollection ^ value); };
public System.Windows.Media.DoubleCollection VisualXSnappingGuidelines { protected internal get; protected set; }
member this.VisualXSnappingGuidelines : System.Windows.Media.DoubleCollection with get, set
Public Property VisualXSnappingGuidelines As DoubleCollection

Property Value


视觉对象的 x 坐标准线集合。The x-coordinate guideline collection of the visual.


像素对齐是内容布局固定到的过程,以便在特定于设备的像素上呈现对象边缘。Pixel snapping is the process in which content layout is fixed so that object edges are rendered on device-specific pixels. WPFWPF 图形系统使用与设备无关的单元来使分辨率和设备独立。The WPFWPF graphics system uses device-independent units to enable resolution and device independence. 每个与设备无关的像素都会随着系统的 每英寸点数 (dpi)dots per inch (dpi) 设置自动进行缩放。Each device independent pixel automatically scales with the system's 每英寸点数 (dpi)dots per inch (dpi) setting. 这为 WPFWPF 应用程序提供了不同 dpidpi 设置的适当缩放,并使应用程序自动感知 dpidpiThis provides WPFWPF applications proper scaling for different dpidpi settings and makes the application automatically dpidpi-aware.

但是,这 dpidpi 独立性可能会因为抗锯齿而产生不规则边缘渲染。However, this dpidpi independence can create irregular edge rendering due to anti-aliasing. 当边缘的位置落在设备像素中间而不是设备像素之间时,可能会出现这些项目,这些项目通常被视为模糊或 "软" 边缘。These artifacts, commonly seen as blurry or "soft" edges, can occur when the location of an edge falls in the middle of a device pixel rather than between device pixels. 若要解决此问题,WPFWPF 提供了一种方法,用于可视化树中的对象边缘与设备像素 "对齐",从而消除抗锯齿产生的软边缘。To address this issue, WPFWPF provides a way for object edges in a visual tree to "snap" to device pixels, eliminating the soft edges produced by anti-aliasing.

Applies to

See also