Table of Contents

Struct UIScaleFactor

Namespace
PaintDotNet
Assembly
PaintDotNet.Core.dll
public readonly struct UIScaleFactor : IEquatable<UIScaleFactor>, IComparable<UIScaleFactor>
Implements
Inherited Members

Properties

Current

Gets the current UI scaling factor, which is based on the user's settings.

Dpi

Gets the DPI (dots-per-inch) for the scaling factor. This will always equal (int)Scale*96.

Legacy

Gets the legacy UI scaling factor, which is always 96 DPI, 1.0 Scale.

Maximum

Gets the maximum UI scaling factor representable by UIScaleFactor.

Minimum

Gets the minimum UI scaling factor representable by UIScaleFactor.

Scale

Gets the scale multiplier for the scaling factor. This will always equal Dpi/96.0.

Methods

CompareTo(UIScaleFactor)
ConvertDipsToPixels(SizeDouble)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixels(SizeFloat)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixels(double)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixels(double, double)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixels(float)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixels(float, float)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

ConvertDipsToPixelsInt(SizeInt32)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

The result is rounded to the nearest whole integer.

ConvertDipsToPixelsInt(int)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

The result is rounded to the nearest whole integer.

ConvertDipsToPixelsInt(int, int)

Converts a measurement from DIPs (device-independent pixels) to pixels using the current scaling factor.

The result is rounded to the nearest whole integer.

ConvertFontPointsToDips(double)

Converts a font size, expressed in points (1/72 inch), to DIPs (device-independent pixels).

ConvertFontPointsToDips(float)

Converts a font size, expressed in points (1/72 inch), to DIPs (device-independent pixels).

ConvertFontPointsToPixels(double)

Converts a font size, expressed in points (1/72 inch), to pixels. This is useful when converting GDI+ (System.Drawing) text rendering code to Direct2D/DirectWrite.

ConvertFontPointsToPixels(float)

Converts a font size, expressed in points (1/72 inch), to pixels. This is useful when converting GDI+ (System.Drawing) text rendering code to Direct2D/DirectWrite.

ConvertPixelsToDips(SizeDouble)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDips(SizeFloat)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDips(double)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDips(double, double)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDips(float)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDips(float, float)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

ConvertPixelsToDipsInt(SizeInt32)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

The result is rounded to the nearest whole integer.

ConvertPixelsToDipsInt(int)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

The result is rounded to the nearest whole integer.

ConvertPixelsToDipsInt(int, int)

Converts a measurement from pixels to DIPs (device-independent pixels) using the current scaling factor.

The result is rounded to the nearest whole integer.

Equals(UIScaleFactor)
Equals(object?)
FromDpi(int)

Creates a UIScaleFactor from the given DPI value.

FromScale(double)

Creates a UIScaleFactor from the given scaling factor.

GetHashCode()
RescalePixels(SizeDouble, UIScaleFactor, UIScaleFactor)

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

RescalePixels(SizeFloat, UIScaleFactor, UIScaleFactor)

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

RescalePixels(double, UIScaleFactor, UIScaleFactor)

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

RescalePixels(double, double, UIScaleFactor, UIScaleFactor)

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

RescalePixels(float, UIScaleFactor, UIScaleFactor)

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

RescalePixels(float, float, UIScaleFactor, UIScaleFactor)

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

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.

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.

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.

Operators

operator ==(UIScaleFactor, UIScaleFactor)
operator >(UIScaleFactor, UIScaleFactor)
operator >=(UIScaleFactor, UIScaleFactor)
operator !=(UIScaleFactor, UIScaleFactor)
operator <(UIScaleFactor, UIScaleFactor)
operator <=(UIScaleFactor, UIScaleFactor)