Export (0) Print
Expand All

BitmapCache.SnapsToDevicePixels Property

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.5.3, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft