Method ToPixels
ToPixels(float, int)
Converts the current coordinate value to pixels based on the specified scale factor and base value.
public int ToPixels(float scaleFactor, int baseValue)
Parameters
scaleFactorfloatThe scale factor used for converting device-independent pixels (DIPs) to pixels. This parameter is only used when the unit is Dip.
baseValueintThe base value, in pixels, used for percentage-based calculations. This parameter is only used when the unit is Percent.
Returns
- int
The coordinate value converted to pixels. The result depends on the current unit: Pixel returns the value as-is, Dip applies the scale factor, and Percent calculates the percentage of the base value.
Exceptions
- NotSupportedException
Thrown if the current unit is not supported.