VintaSoft Barcode .NET SDK Discussions
Questions, comments and suggestions concerning VintaSoft Barcode .NET SDK.
Board index < VintaSoft Barcode < VintaSoft Barcode .NET SDK Discussions
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);
}
And it is called here.
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);
}
The barcode itself is generated, but not the text below. If I go for 'way 1'.In this case you need to scale the image but this may decrease the barcode image quality.
How can I set the width of the barcode (so that it will fit our label)?
Because I leave out that parameter now.