BitmapCache.SnapsToDevicePixels BitmapCache.SnapsToDevicePixels BitmapCache.SnapsToDevicePixels BitmapCache.SnapsToDevicePixels Property


Gets or sets a value that indicates whether the bitmap is rendered with pixel snapping.

 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

Property Value

true if pixel snapping is active; otherwise, false. The default is false.


Set the SnapsToDevicePixels property when the cache displays content that requires pixel-alignment to render correctly. This is the case for ClearType text. If you set the EnableClearType property to true, consider setting SnapsToDevicePixels to true to ensure proper rendering.

When the SnapsToDevicePixels property is set to false, you can move and scale the cached element by a fraction of a pixel, and bilinear filtering is applied.

When the SnapsToDevicePixels property is set to true, the bitmap cache is aligned with pixel boundaries of the destination. If you move or scale the cached element by a fraction of a pixel, the bitmap snaps to the pixel grid. In this case, the top-left corner of the bitmap is rounded up and snapped to the pixel grid, but the bottom-right corner is on a fractional pixel boundary.

The SnapsToDevicePixels property is ignored by BitmapCacheBrush and when used with a Viewport2DVisual3D.

Applies to

See also