Unit of Measurement
The unit of measurement can be changed by updating the Unit property. The default unit to draw a barcode is Pixel.
Below are the different Unit of Measurements. The Dimension below represents a width/height of the barcode.
UnitOfMeasurement.Pixel
: 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.
1 inch of image is drawn as of dpi (1 inch at 300 Dpi you need 300 pixels to draw).
- 1 Millimeter = 0.03037 Inch
- 1 Mil = 0.001 Inch
- 1 Point = 0.138 Inch
Pixel is independent of dpi.
Pixel is default unit of measurement.
It can be changed by using property.
barcode.Unit = UnitOfMeasurement.Inch;
barcode.Unit = UnitOfMeasurement.Inch