DpiHelper.DpiHelperImplementation Class

Definition

The DpiHelper actual implementation. Derives from the DpiHelper scaling helper, and overrides a couple of functions allowing user-override of the scaling algorithms via registry settings under the running appid's hive.

public: ref class DpiHelper::DpiHelperImplementation : Microsoft::VisualStudio::Utilities::Dpi::DpiHelper
[Windows::Foundation::Metadata::WebHostHidden]
class DpiHelper::DpiHelperImplementation : Microsoft::VisualStudio::Utilities::Dpi::DpiHelper
public class DpiHelper.DpiHelperImplementation : Microsoft.VisualStudio.Utilities.Dpi.DpiHelper
type DpiHelper.DpiHelperImplementation = class
    inherit DpiHelper
Public Class DpiHelper.DpiHelperImplementation
Inherits DpiHelper
Inheritance
DpiHelper.DpiHelperImplementation

Constructors

DpiHelper.DpiHelperImplementation()

Initializes a new instance of DpiHelperImplementation.

Fields

DefaultLogicalDpi

The default logical DPI.

(Inherited from DpiHelper)

Properties

BitmapScalingMode

The BitmapScalingMode.

(Inherited from DpiHelper)
DeviceDpiX

Gets the screen's (device) current horizontal DPI.

(Inherited from DpiHelper)
DeviceDpiY

The screen's (device) current vertical DPI.

(Inherited from DpiHelper)
DeviceToLogicalUnitsScalingFactorX

Converts to the horizontal logical units scaling factor.

(Inherited from DpiHelper)
DeviceToLogicalUnitsScalingFactorY

Converts to the vertical logical units scaling factor.

(Inherited from DpiHelper)
DpiScalePercentX (Inherited from DpiHelper)
DpiScalePercentY (Inherited from DpiHelper)
ImageScalingMode

Gets the ImageScalingMode algorithm to be used for resizing images in WinForms/Win32. This allows the shell to control the algorithm depending on the DPI zoom scale, and allows the user to override it via registry settings like General\ImageScalingXXX = (ImageScalingMode)value, with XXX the zoom factor in percents, e.g. ImageScaling150, etc.

(Inherited from DpiHelper)
IsScalingRequired

Determines whether scaling is required when converting between logical-device units

(Inherited from DpiHelper)
LogicalDpiX

Gets the helper's logical horizontal DPI.

(Inherited from DpiHelper)
LogicalDpiY

Gets the helper's vertical horizontal DPI.

(Inherited from DpiHelper)
LogicalToDeviceUnitsScalingFactorX (Inherited from DpiHelper)
LogicalToDeviceUnitsScalingFactorY (Inherited from DpiHelper)
PreScaledImageLayoutTransformScaleX

Gets the horizontal scale value that should be used with a LayoutTransform/ScaleTransform to scale back an image pre-scaled in HighDPI with DpiPrescaleImageSourceConverter in order to obtain crisp results.

(Inherited from DpiHelper)
PreScaledImageLayoutTransformScaleY

Gets the vertical scale value that should be used with a LayoutTransform/ScaleTransform to scale back an image pre-scaled in HighDPI with DpiPrescaleImageSourceConverter in order to obtain crisp results.

(Inherited from DpiHelper)
SettingsStore
TransformFromDevice (Inherited from DpiHelper)
TransformToDevice (Inherited from DpiHelper)
UsePreScaledImages

Determines whether images should be pre-scaled at zoom levels higher than 200%, using NearestNeighbor up to the largest multiple of 100%

(Inherited from DpiHelper)

Methods

CreateDeviceFromLogicalImage(Bitmap, Size, Color, ImageScalingMode)

Creates and returns a new bitmap strip from the logical Bitmap scaled for the device units. When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi. This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale). This may happen depending on the image width because dpiscale is a double not an int.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(Bitmap, Size, ImageScalingMode)

Creates and returns a new bitmap strip from the logical Bitmap scaled for the device units. When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi. This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale). This may happen depending on the image width because dpiscale is a double not an int.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(Icon, ImageScalingMode)

Creates and returns a new icon scaled for the device units. When displayed on the device, the scaled icon will have same size as the original icon would have when displayed at 96dpi.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(Image, Color, ImageScalingMode)

Creates and returns a new ImageList scaled for the device units. When displayed on the device, the scaled ImageList will have same size as the original ImageList would have when displayed at 96dpi.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(Image, ImageScalingMode)

Creates and returns a new bitmap or metafile from the logical Image scaled for the device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(ImageList, Color, ImageScalingMode)

Creates and returns a new ImageList scaled for the device units. When displayed on the device, the scaled ImageList will have same size as the original imagelist would have when displayed at 96dpi.

(Inherited from DpiHelper)
CreateDeviceFromLogicalImage(ImageList, ImageScalingMode)

Creates and returns a new ImageList scaled for the device units. When displayed on the device, the scaled ImageList will have same size as the original ImageList would have when displayed at 96dpi.

(Inherited from DpiHelper)
DeviceToLogicalUnits(Point)

Returns a new Point with the input's coordinates converted from device units to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnits(Rect)

Returns a new Rect with the input's coordinates converted from device units to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnits(Size)

Returns a new Size with the input's dimensions converted from device units to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnits(Thickness)

Returns a new Thickness with the input's dimensions converted from device units to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnitsX(Double)

Transforms a horizontal coordinate from device to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnitsX(Int32)

Transforms a horizontal integer coordinate from device to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnitsX(Single) (Inherited from DpiHelper)
DeviceToLogicalUnitsY(Double)

Transforms a vertical coordinate from device to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnitsY(Int32)

Transforms a vertical coordinate from device to logical units.

(Inherited from DpiHelper)
DeviceToLogicalUnitsY(Single)

Transforms a vertical coordinate from device to logical units.

(Inherited from DpiHelper)
GetBitmapScalingModeOverride(Int32, BitmapScalingMode)

Gets the bitmap scaling mode override.

GetDeviceActualSize(FrameworkElement)

Gets the FrameworkElement's Size in device units.

(Inherited from DpiHelper)
GetDeviceHeight(Window)

Gets the window's height in device units.

(Inherited from DpiHelper)
GetDeviceLeft(Window)

Gets the window's left coordinate in device units.

(Inherited from DpiHelper)
GetDeviceRect(Window)

Gets the window's rectangle in device units.

(Inherited from DpiHelper)
GetDeviceTop(Window)

Gets the window's top in device units.

(Inherited from DpiHelper)
GetDeviceWidth(Window)

Gets the window's width in device units.

(Inherited from DpiHelper)
GetImageScalingModeOverride(Int32, ImageScalingMode)

Gets the image scaling mode override.

GetUsePreScaledImagesOverride(Int32, Boolean)

Determines whether prescaled images should be used.

LogicalToDeviceUnits(Bitmap, Color, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Bitmap, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Bitmap, Size, Color, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Bitmap, Size, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Icon, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Image, Color, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Image, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(ImageList, Color, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(ImageList, ImageScalingMode) (Inherited from DpiHelper)
LogicalToDeviceUnits(Point) (Inherited from DpiHelper)
LogicalToDeviceUnits(Point) (Inherited from DpiHelper)
LogicalToDeviceUnits(PointF) (Inherited from DpiHelper)
LogicalToDeviceUnits(Rect) (Inherited from DpiHelper)
LogicalToDeviceUnits(Rectangle) (Inherited from DpiHelper)
LogicalToDeviceUnits(RectangleF) (Inherited from DpiHelper)
LogicalToDeviceUnits(Size) (Inherited from DpiHelper)
LogicalToDeviceUnits(Size) (Inherited from DpiHelper)
LogicalToDeviceUnits(SizeF) (Inherited from DpiHelper)
LogicalToDeviceUnits(Thickness) (Inherited from DpiHelper)
LogicalToDeviceUnitsX(Double) (Inherited from DpiHelper)
LogicalToDeviceUnitsX(Int32) (Inherited from DpiHelper)
LogicalToDeviceUnitsX(Single) (Inherited from DpiHelper)
LogicalToDeviceUnitsY(Double) (Inherited from DpiHelper)
LogicalToDeviceUnitsY(Int32) (Inherited from DpiHelper)
LogicalToDeviceUnitsY(Single) (Inherited from DpiHelper)
RoundToDeviceUnitsX(Double) (Inherited from DpiHelper)
RoundToDeviceUnitsY(Double) (Inherited from DpiHelper)
ScaleLogicalImageForDeviceSize(ImageSource, Size, BitmapScalingMode) (Inherited from DpiHelper)
SetDeviceHeight(Window, Double) (Inherited from DpiHelper)
SetDeviceLeft(Window, Double) (Inherited from DpiHelper)
SetDeviceTop(Window, Double) (Inherited from DpiHelper)
SetDeviceWidth(Window, Double) (Inherited from DpiHelper)

Applies to