Print human readable text below barcode
Posted: Mon Dec 03, 2018 12:41 pm
Hi,
I'm using the Barcode sdk in my .net (C# Winforms) application.
I would like to add human readable text below the barcode (with the same value as the barcode itself) but so far I am failing to do so.
I have been reading the documentation and to my best knowledge the text below the barcode 'should' be shown by default, but in my case it is not.
I tried the PrintableValue (default is the value if I'm not mistaken)
ValueVisible is set to true (also default)
What am I missing here?
This is the part that 'generates' the barcode.
And it is called here.
The barcode itself is generated, but not the text below.
Thanks in advance,
Peter
I'm using the Barcode sdk in my .net (C# Winforms) application.
I would like to add human readable text below the barcode (with the same value as the barcode itself) but so far I am failing to do so.
I have been reading the documentation and to my best knowledge the text below the barcode 'should' be shown by default, but in my case it is not.
I tried the PrintableValue (default is the value if I'm not mistaken)
ValueVisible is set to true (also default)
What am I missing here?
This is the part that 'generates' the barcode.
Code: Select all
public static Image DrawBarcode(BarcodeType barcode, string value, float resolution, float width,
float height, UnitOfMeasure units)
{
// create the barcode writer
BarcodeWriter writer = new BarcodeWriter();
// set barcode writer settings
writer.Settings.Barcode = barcode;
writer.Settings.Value = value;
writer.Settings.Resolution = resolution;
writer.Settings.PixelFormat = BarcodeImagePixelFormat.Bgr24;
writer.Settings.ValueVisible = true;
writer.Settings.ValueAutoLetterSpacing = true;
// return barcode image
return writer.GetBarcodeAsBitmap(width, height, UnitOfMeasure.Centimeters);
}
Code: Select all
string barcode = "13245";
using (Image barcodeImage = DrawBarcode(BarcodeType.Code128, barcode, 250, 7, 2,
UnitOfMeasure.Centimeters))
{
Point locean = new Point(20, 225);
e.Graphics.DrawImage(barcodeImage, locean);
}
Thanks in advance,
Peter