Page 1 of 1

Create barcode with transparent background.

Posted: Mon Oct 05, 2015 9:48 am
by Alex
Transparent colors are supported in RGBA images, i.e. in 32- and 64-bit images.

Here is an example that shows how to create barcode with transparent background:

Code: Select all

public static System.Drawing.Bitmap GenerateBarcodeWithTransparentBackground(Vintasoft.Barcode.BarcodeType type, string value)
    Vintasoft.Barcode.BarcodeWriter writer = new Vintasoft.Barcode.BarcodeWriter();
    writer.Settings.Barcode = type;
    writer.Settings.Value = value;
    writer.Settings.PixelFormat = Vintasoft.Barcode.BarcodeImagePixelFormat.Bgra32;
    writer.Settings.BackColor = System.Drawing.Color.Transparent;
    return writer.GetBarcodeAsBitmap();