Skip to main content
A newer version of this page is available. .

PixelSnapper Class

Enables pixel snapping.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core

Declaration

public class PixelSnapper :
    PixelSnapperBase

Remarks

Dpi independence can create irregular edge rendering due to anti-aliasing. These artifacts, commonly seen as blurry or semi-transparent edges, can occur when the location of an edge falls in the middle of a device pixel rather than between device pixels. To avoid blurring of visuals in WPF applications, locate them inside the PixelSnapper.

<dx:PixelSnapper>
    <Image Source="{Binding Path=Link.Item.Glyph, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>
</dx:PixelSnapper>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PixelSnapper class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
DispatcherObject
DependencyObject
Visual
UIElement
FrameworkElement
Decorator
DevExpress.Xpf.Core.Internal.PixelSnapperBase
PixelSnapper
See Also