Code samples

Code samples for VintaSoft Barcode .NET SDK. Here you can request a code sample.

Board index < VintaSoft Barcode < VintaSoft Barcode .NET SDK Discussions < Code samples

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Console: Create barcode with transparent background.



Console: Create barcode with transparent background.

Post by Alex »

Transparent colors are supported in RGBA images, i.e. in 32- and 64-bit images.

Here is C# example that shows how to create barcode with transparent background:
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();
}


Page 1 from 1: 1