Convert Measurement Units
IronDrawing provides option for users who wants to change the measurement unit used in Rectangle
or RectangleF
from pixels (px) to milimeters (mm) or vice versa. Default measurement unit used in Rectangle
and RectangleF
is pixels (px).
After a new Rectangle
with measurements specified has been instantiated, call the conversion method to the Rectangle
. For example .ConvertTo(MeasurementUnits.Millimeters, 20)
. This will convert the measurements of the Rectangle
to millimeters based on the DPI set by users. This same approach can also be applied for RectangleF
class.