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
doublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
doubleheightPx
doublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
SizeDoublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
floatsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
floatheightPx
floatsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
SizeFloatsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
Remarks
This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.