DpiPrescaledImageExtension DpiPrescaledImageExtension DpiPrescaledImageExtension DpiPrescaledImageExtension Class

Definition

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

public ref class DpiPrescaledImageExtension sealed : Microsoft::VisualStudio::Imaging::Dpi::DpiPrescaledImageExtension
public sealed class DpiPrescaledImageExtension : Microsoft.VisualStudio.Imaging.Dpi.DpiPrescaledImageExtension
type DpiPrescaledImageExtension = class
    inherit DpiPrescaledImageExtension
Public NotInheritable Class DpiPrescaledImageExtension
Inherits DpiPrescaledImageExtension
Inheritance

Remarks

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.

Constructors

DpiPrescaledImageExtension() DpiPrescaledImageExtension() DpiPrescaledImageExtension() DpiPrescaledImageExtension()

Initializes a new instance of DpiPrescaleImageExtension.

DpiPrescaledImageExtension(String) DpiPrescaledImageExtension(String) DpiPrescaledImageExtension(String) DpiPrescaledImageExtension(String)

Initializes a new instance of DpiPrescaleImageExtension.

Properties

PrescalingConverter PrescalingConverter PrescalingConverter PrescalingConverter

Gets an instance of the DpiPrescaleImageSourceConverter.

(Inherited from DpiPrescaledImageExtension)
Uri Uri Uri Uri

Gets or sets the URI.

(Inherited from DpiPrescaledImageExtension)

Methods

ProvideValue(IServiceProvider) ProvideValue(IServiceProvider) ProvideValue(IServiceProvider) ProvideValue(IServiceProvider) Inherited from DpiPrescaledImageExtension

Applies to