VintaSoft Barcode .NET SDK 12.5
In This Topic
    Get barcode image as System.Drawing.Bitmap object
    In This Topic
    Example: Here is an example that shows how to generate barcode as a System.Drawing.Bitmap object and save the bitmap to a file.
    // create the barcode writer
    Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter();
    
    // set barcode writer settings
    barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.Code128;
    barcodeWriter.Settings.Value = "012345abcde";
    
    // get a barcode image
    System.Drawing.Image image = barcodeWriter.GetBarcodeAsBitmap();
    
    // save the barcode image to a file
    image.Save("imageWihBarcode.png");
    
    ' create the barcode writer
    Dim barcodeWriter As New BarcodeWriter()
    
    ' set barcode writer settings
    barcodeWriter.Settings.Barcode = BarcodeType.Code128
    barcodeWriter.Settings.Value = "012345abcde"
    
    ' get a barcode image
    Dim image As Image = barcodeWriter.GetBarcodeAsBitmap()
    
    ' save the barcode image to a file
    image.Save("imageWihBarcode.png")