Unit of Measurement
Change the unit of measurement by updating the Unit property. The default unit to draw a barcode is Pixel.
The following table lists the different available units of measurement. The dimension below represents a width/height of the barcode.
|Unit of Measure||Dimensions|
|UnitOfMeasurement.Pixel||This unit of measure uses the dimension as is.|
|UnitOfMeasurement.Inch||Multiplying the dimension with DPI will give the width in pixels. pixelWidth = dimension * dpi (Dots Per Inch)|
|UnitOfMeasurement.Millimeter||1 millimeter = 0.03937 Inches pixelWidth = (dimension * 0.03937f) * dpi (Dots Per Inch)|
|UnitOfMeasurement.Mil||1 mil = 0.001 Inches pixelWidth = (dimension * 0.001f) * dpi (Dots Per Inch)|
|UnitOfMeasurement.Point||1 point = 0.0138 Inches pixelWidth = (dimension * 0.0138f) * dpi (Dots Per Inch)|
The default unit of measurement used by DynamicBarcode Creator for .NET is pixels, as specified by the UnitOfMeasurement.Pixel.
DPI is a measure of dots per inch and determines a barcode's pixel resolution. For instance, one inch at 300 Dpi you need 300 pixels to draw. The following are some common measurement conversions.
- 1 Millimeter = 0.03037 Inch
- 1 Mil = 0.001 Inch
- 1 Point = 0.138 Inch
Note that pixels are independent of dpi and that pixels are the default unit of measurement. You can change unit of measurement property by setting the bar code's Unit property. The following example illustrates.
barcode.Unit = UnitOfMeasurement.Inch;
barcode.Unit = UnitOfMeasurement.Inch