DpiPrescaledImageExtension Class
Represents a MarkupExtension class that can be used to declare image sources in XAML and have the image pre-scaled for High DPI at zoom levels higher than 200%, using NearestNeighbor up to the largest multiple of 100%.
Assembly: Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
System.Windows.Markup.MarkupExtension
Microsoft.VisualStudio.Imaging.Dpi.DpiPrescaledImageExtension
Microsoft.VisualStudio.PlatformUI.DpiPrescaledImageExtension
| Name | Description | |
|---|---|---|
![]() | DpiPrescaledImageExtension() | Initializes a new instance of DpiPrescaleImageExtension. |
![]() | DpiPrescaledImageExtension(String) | Initializes a new instance of DpiPrescaleImageExtension. |
| Name | Description | |
|---|---|---|
![]() | Uri | Gets or sets the URI.(Inherited from DpiPrescaledImageExtension.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | ProvideValue(IServiceProvider) | (Inherited from DpiPrescaledImageExtension.) |
![]() | ToString() | (Inherited from Object.) |
A common usage pattern can look like this:
<Image Source="{imaging:DpiPrescaledImage resources/MyImage.png}" Width="16" Height="16" />
or
<Image Source="{imaging:DpiPrescaledImage resources/MyImage.png}" Stretch="None">
<Image.LayoutTransform>
<ScaleTransform ScaleX="{x:Static utilities:DpiHelper.Default.PreScaledImageLayoutTransformScaleX}" ScaleY="{x:Static utilities:DpiHelper.Default.PreScaledImageLayoutTransformScaleY}" />
</Image.LayoutTransform>
</Image>
Note that when using image pre-scaling, either the original image size has to be specified, or a reverse layout transform has to be applied to the result, to maintain the desired original image size.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

