Table of Contents

Method ToPixelsRounded

Namespace
LMKit.Graphics.Geometry
Assembly
LM-Kit.NET.dll

ToPixelsRounded(double, UnitMode, double, MidpointRounding)

Converts a value to pixels and rounds to the nearest integer using the specified midpoint strategy.

public static int ToPixelsRounded(double value, UnitMode from, double dpi = 96, MidpointRounding mode = MidpointRounding.AwayFromZero)

Parameters

value double

The value to convert.

from UnitMode

The source unit.

dpi double

Effective DPI. Default is 96.

mode MidpointRounding

Rounding strategy. Default is AwayFromZero.

Returns

int

Rounded pixel value.