Windows Dev Center

Information
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.

BitmapCache.SnapsToDevicePixels Property

.NET Framework 4.6 and 4.5

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

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public bool SnapsToDevicePixels { get; set; }
<object SnapsToDevicePixels="bool" .../>

Property Value

Type: System.Boolean
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.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft