Windows apps
Collapse the table of content
Expand the table of content
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 (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public bool SnapsToDevicePixels { get; set; }

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
Available since 4.0
Return to top
Show:
© 2017 Microsoft