Table of Contents

Method RescalePixels

Namespace
PaintDotNet
Assembly
PaintDotNet.Core.dll

RescalePixels(double, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static double RescalePixels(double px, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

px double
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

double

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.

RescalePixels(double, double, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static SizeDouble RescalePixels(double widthPx, double heightPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

widthPx double
heightPx double
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

SizeDouble

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.

RescalePixels(SizeDouble, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static SizeDouble RescalePixels(SizeDouble sizePx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

sizePx SizeDouble
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

SizeDouble

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.

RescalePixels(float, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static float RescalePixels(float px, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

px float
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

float

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.

RescalePixels(float, float, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static SizeFloat RescalePixels(float widthPx, float heightPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

widthPx float
heightPx float
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

SizeFloat

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.

RescalePixels(SizeFloat, UIScaleFactor, UIScaleFactor)

Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.

public static SizeFloat RescalePixels(SizeFloat sizePx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

sizePx SizeFloat
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

SizeFloat

Remarks

This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.