Table of Contents

Method PixelFromDip

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

PixelFromDip(SizeD, float?)

Converts device-independent units to pixels.

public static SizeI PixelFromDip(SizeD value, float? scaleFactor = null)

Parameters

value SizeD

Value in device-independent units.

scaleFactor float?

Scale factor used for the conversion. Optional. If not specified, default value is used.

Returns

SizeI

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

value RectD[]

An array of rectangles defined in device-independent pixels (DIPs) to be converted to pixel units.

scaleFactor float?

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

value PointD

Value in device-independent units.

scaleFactor float?

Scale factor used for the conversion. Optional. If not specified, default value is used.

Returns

PointI

PixelFromDip(RectD, float?)

Converts device-independent units to pixels.

public static RectI PixelFromDip(RectD value, float? scaleFactor = null)

Parameters

value RectD

Value in device-independent units.

scaleFactor float?

Scale factor used for the conversion. Optional. If not specified, default value is used.

Returns

RectI

PixelFromDip(float, float?)

Converts device-independent units to pixels.

public static int PixelFromDip(float value, float? scaleFactor = null)

Parameters

value float

Value in device-independent units.

scaleFactor float?

Scale factor.

Returns

int

Converted value.