Barcode.Draw

Overloads

Draw(Single, ImageFormat)Draw barcode image.
Draw(Single, Single, ImageFormat)Draw barcode image.
Draw(String, Single, ImageFormat)Draw barcode image.
Draw(String, Single, Single, ImageFormat)Draw barcode image.

Draw(Single, ImageFormat)

Draw barcode image.

public Byte[] Draw(float dpi, ImageFormat imageFormat)

Parameters

dpi
Single

Image resolution for barcode image.

imageFormat
ImageFormat

Image format for barcode image.

Returns

Byte[]

Image data as byte array.

Licensing Info

This method is a DynamicBarcode Creator feature. One of the following is required for non-evaluation usage:

Examples

This example shows how to output the barcode image to a byte array.

using System;
using ceTe.DynamicBarcode.Creator;

class MyClass
{
    static void Main()
    {
        // Create a barcode object.
        Code11 barcode = new Code11("12345678", 50);

        // Save the barcode image to a byte array
       byte[] barcodeData =  barcode.Draw(96, ImageFormat.Png);
       
    }
}

Draw(Single, Single, ImageFormat)

Draw barcode image.

public Byte[] Draw(float horizontalDpi, float verticalDpi, ImageFormat imageFormat)

Parameters

horizontalDpi
Single

Horizontal resolution for barcode image.

verticalDpi
Single

Vertical resolution for barcode image.

imageFormat
ImageFormat

Image format for barcode image.

Returns

Byte[]

Image data as byte array.

Licensing Info

This method is a DynamicBarcode Creator feature. One of the following is required for non-evaluation usage:

Examples

This example shows how to output the barcode image to a byte array.

using System;
using ceTe.DynamicBarcode.Creator;

class MyClass
{
    static void Main()
    {
        // Create a barcode object.
        Code11 barcode = new Code11("12345678", 50);

        // Save the barcode image to a byte array
       byte[] barcodeData = barcode.Draw(96, 96, ImageFormat.Png);
    }
}

Draw(String, Single, ImageFormat)

Draw barcode image.

public void Draw(string filePath, float dpi, ImageFormat imageFormat)

Parameters

filePath
String

Input file path to save image.

dpi
Single

Image resolution for barcode image.

imageFormat
ImageFormat

Image format for barcode image.

Licensing Info

This method is a DynamicBarcode Creator feature. One of the following is required for non-evaluation usage:

Examples

The following example will Draw a Codabar barcode image.

using System;
using ceTe.DynamicBarcode.Creator;

class MyClass
{ 
    static void Main()
    {
        // Create a barcode object.
        Codabar barcode = new Codabar("A1234A", 100);

        // Draw barcode image.
       barcode.Draw(@"C:\barcode.png", 96, ImageFormat.Png);
       
    }
}

Draw(String, Single, Single, ImageFormat)

Draw barcode image.

public void Draw(string filePath, float horizontalDpi, float verticalDpi, ImageFormat imageFormat)

Parameters

filePath
String

Input file path to save image.

horizontalDpi
Single

Horizontal resolution for barcode image.

verticalDpi
Single

Vertical resolution for barcode image.

imageFormat
ImageFormat

Image format for barcode image.

Licensing Info

This method is a DynamicBarcode Creator feature. One of the following is required for non-evaluation usage:

Examples

The following example will Draw a Codabar barcode image.

using System;
using ceTe.DynamicBarcode.Creator;

class MyClass
{ 
    static void Main()
    {
        // Create a barcode object.
        Codabar barcode = new Codabar("A1234A", 100);

        // Draw barcode image.
       barcode.Draw(@"C:\barcode.png", 96, 96, ImageFormat.Png);
       
    }
}

See Also

Barcode
ceTe.DynamicBarcode.Creator