Console: Create barcode with transparent background.

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

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 2300
Joined: Thu Jul 10, 2008 2:21 pm

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:

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();
}
Post Reply