Method ToPixelsRounded
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
valuedoubleThe value to convert.
fromUnitModeThe source unit.
dpidoubleEffective DPI. Default is 96.
modeMidpointRoundingRounding strategy. Default is AwayFromZero.
Returns
- int
Rounded pixel value.