How to create barcodes using C# or VB.NET and Barcode Professional for Windows
Forms that must fit a given size or area
Technologies used
- Neodynamic Barcode Professional 3.0 for Windows Forms
- Microsoft .NET Framework (all versions)
|
It's very common to need to create a barcode image in order it
fits a given area, for instance: The barcode must fit an area of size 1.5 inch
x 1 inch.
One version of the GetBarcodeImage() method that Barcode
Professional features, lets you to accomplish that by specifying the target
area through barsAreaSizeInInches parameter. Please keep in mind the
following points about the target area:
-
The target area's size (width and height) is measured in inches
-
The target Width includes the whole barcode bars width plus left and
right Quiet Zones (QuietZoneWidth
property)
-
The target Height includes the barcode bar's height only
Example
You want to encode the data 1234567890 in Code 128 at 300DPI
and the barcode must fit an area of size 1 inch x 0.5 inch
Remember that the target Width includes the whole barcode bars width plus left and right Quiet Zones (QuietZoneWidth property) while the target Height includes the barcode bar's height only as is shown in the following figure (produced with the previous code)
If you want to fulfill the whole target area with the barcode only, then you should just set the QuietZoneWidth property to zero (in order to rid of the left and right margins) and set the DisplayCode property to false (in order to hide the human readable text) as is shown in the following code.
This code will produce the following barcode image. Note that in this case, the barcode fulfills the specified target area.
If you need more information or assistance, please contact our
.
|