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: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Create barcode with transparent background.

Post by Alex » Mon Oct 05, 2015 9:48 am

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 Bitmap GenerateBarcodeWithTransparentBackground(BarcodeType type, string value)
{
    BarcodeWriter writer = new BarcodeWriter();
    writer.Settings.Barcode = type;
    writer.Settings.Value = value;
    writer.Settings.PixelFormat = BarcodeImagePixelFormat.Bgra32;
    writer.Settings.BackColor = Color.Transparent;
    return writer.GetBarcodeAsBitmap();
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest