UIElement.SnapsToDevicePixels プロパティ
定義
この要素のレンダリングがレンダリング中にデバイスに固有のピクセルの設定を使用するかどうかを決定する値を取得または設定します。Gets or sets a value that determines whether rendering for this element should use device-specific pixel settings during rendering. これは依存関係プロパティです。This is a dependency property.
public:
property bool SnapsToDevicePixels { bool get(); void set(bool value); };
public bool SnapsToDevicePixels { get; set; }
member this.SnapsToDevicePixels : bool with get, set
Public Property SnapsToDevicePixels As Boolean
プロパティ値
デバイスのピクセルに従って要素を描画する場合はtrue
、それ以外の場合は false
。true
if the element should render in accordance to device pixels; otherwise, false
. UIElement で宣言された既定値は false
です。The default as declared on UIElement is false
.
注釈
このプロパティをルート要素で true
に設定すると、UI 全体でピクセルスナップレンダリングを有効にすることができます。You can set this property to true
on your root element to enable pixel snap rendering throughout the UI. 96 ドット/インチ (dpi)dots per inch (dpi)より大きいデバイスでは、ピクセルスナップレンダリングを使用すると、単一行の実線の中で、アンチエイリアシングの視覚的成果物を最小限に抑えることができます。For devices operating at greater than 96 ドット/インチ (dpi)dots per inch (dpi), pixel snap rendering can minimize anti-aliasing visual artifacts in the vicinity of single-unit solid lines.
FrameworkElement または考えられる派生クラスによって継承されると、FrameworkElement この依存関係プロパティのメタデータをオーバーライドして、Inherits メタデータプロパティを true
に設定します。When inherited by FrameworkElement or any possible derived classes, FrameworkElement overrides the metadata for this dependency property to set the Inherits metadata property to true
. これによって実現されるのは、サブツリー内の最も外側の要素だけが true
として SnapsToDevicePixels を指定する必要があり、そのサブツリーのすべての子要素が true
として SnapsToDevicePixels を報告し、視覚効果が SnapsToDevicePixels されることです。What this achieves is that only the outermost element in a subtree needs to specify SnapsToDevicePixels as true
, and all child elements of that subtree will then report SnapsToDevicePixels as true
and will have the SnapsToDevicePixels visual effect.
依存プロパティ情報Dependency Property Information
識別子フィールドIdentifier field | SnapsToDevicePixelsProperty |
メタデータプロパティが true に設定されるMetadata properties set to true |
なしNone |