Method RescalePixelsInt
- Namespace
- PaintDotNet
- Assembly
- PaintDotNet.Core.dll
RescalePixelsInt(int, UIScaleFactor, UIScaleFactor)
Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.
The result is rounded to the nearest whole integer. If the input is non-zero then the output is guaranteed to be non-zero.
public static int RescalePixelsInt(int px, UIScaleFactor sourceScale, UIScaleFactor targetScale)
Parameters
px
intsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
Remarks
This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.
RescalePixelsInt(int, int, UIScaleFactor, UIScaleFactor)
Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.
The result is rounded to the nearest whole integer. If the input is non-zero then the output is guaranteed to be non-zero.
public static SizeInt32 RescalePixelsInt(int widthPx, int heightPx, UIScaleFactor sourceScale, UIScaleFactor targetScale)
Parameters
widthPx
intheightPx
intsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
Remarks
This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.
RescalePixelsInt(SizeInt32, UIScaleFactor, UIScaleFactor)
Converts pixels to DIPs using the source scale, then converts from DIPs to pixels using the target scale.
The result is rounded to the nearest whole integer. If the input is non-zero then the output is guaranteed to be non-zero.
public static SizeInt32 RescalePixelsInt(SizeInt32 sizePx, UIScaleFactor sourceScale, UIScaleFactor targetScale)
Parameters
sizePx
SizeInt32sourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
Remarks
This is useful for scaling a bitmap from its DPI setting to the DPI setting for the display.