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.
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
Point2DoublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
Point2FloatsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
Vector2DoublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
Vector2FloatsourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
RectDoublesourceScale
UIScaleFactortargetScale
UIScaleFactor
Returns
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
RectFloatsourceScale
UIScaleFactortargetScale
UIScaleFactor