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.

RescalePixels(Point2Double, UIScaleFactor, UIScaleFactor)

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

public static Point2Double RescalePixels(Point2Double pointPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

pointPx Point2Double
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

Point2Double

RescalePixels(Point2Float, UIScaleFactor, UIScaleFactor)

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

public static Point2Float RescalePixels(Point2Float pointPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

pointPx Point2Float
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

Point2Float

RescalePixels(Vector2Double, UIScaleFactor, UIScaleFactor)

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

public static Vector2Double RescalePixels(Vector2Double vectorPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

vectorPx Vector2Double
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

Vector2Double

RescalePixels(Vector2Float, UIScaleFactor, UIScaleFactor)

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

public static Vector2Float RescalePixels(Vector2Float vectorPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

vectorPx Vector2Float
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

Vector2Float

RescalePixels(RectDouble, UIScaleFactor, UIScaleFactor)

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

public static RectDouble RescalePixels(RectDouble rectPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

rectPx RectDouble
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

RectDouble

RescalePixels(RectFloat, UIScaleFactor, UIScaleFactor)

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

public static RectFloat RescalePixels(RectFloat rectPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)

Parameters

rectPx RectFloat
sourceScale UIScaleFactor
targetScale UIScaleFactor

Returns

RectFloat