Method PixelFromDip
PixelFromDip(SizeD, float?)
Converts device-independent units to pixels.
public static SizeI PixelFromDip(SizeD value, float? scaleFactor = null)
Parameters
valueSizeDValue in device-independent units.
scaleFactorfloat?Scale factor used for the conversion. Optional. If not specified, default value is used.
Returns
PixelFromDip(RectD[], float?)
Converts an array of rectangles from device-independent pixels (DIPs) to pixels using the specified scale factor.
public static RectI[] PixelFromDip(RectD[] value, float? scaleFactor = null)
Parameters
valueRectD[]An array of rectangles defined in device-independent pixels (DIPs) to be converted to pixel units.
scaleFactorfloat?An optional scale factor that determines the conversion from DIPs to pixels. If not specified, a default scale factor is used.
Returns
- RectI[]
An array of rectangles in pixel units corresponding to the input rectangles in DIPs.
Remarks
This method is useful for scenarios where pixel-accurate rendering is required, such as adapting graphics to different display resolutions. The conversion ensures that the rectangles are appropriately scaled for the target device.
PixelFromDip(PointD, float?)
Converts device-independent units to pixels.
public static PointI PixelFromDip(PointD value, float? scaleFactor = null)
Parameters
valuePointDValue in device-independent units.
scaleFactorfloat?Scale factor used for the conversion. Optional. If not specified, default value is used.
Returns
PixelFromDip(RectD, float?)
Converts device-independent units to pixels.
public static RectI PixelFromDip(RectD value, float? scaleFactor = null)
Parameters
valueRectDValue in device-independent units.
scaleFactorfloat?Scale factor used for the conversion. Optional. If not specified, default value is used.
Returns
PixelFromDip(float, float?)
Converts device-independent units to pixels.
public static int PixelFromDip(float value, float? scaleFactor = null)
Parameters
Returns
- int
Converted value.