Class BarcodeGenerator
Generates barcode images for a specified symbology and code text.
Implements
Inherited Members
Namespace: DRIT.Barcode.Generation
Assembly: DRIT.Barcode.dll
Syntax
public class BarcodeGenerator : IDisposable
Constructors
BarcodeGenerator(BaseEncodeType)
Initializes a new BarcodeGenerator with the specified encode type.
Declaration
public BarcodeGenerator(BaseEncodeType encodeType)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseEncodeType | encodeType | The barcode symbology to generate. |
BarcodeGenerator(BaseEncodeType, string)
Initializes a new BarcodeGenerator with the specified encode type and code text.
Declaration
public BarcodeGenerator(BaseEncodeType encodeType, string codeText)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseEncodeType | encodeType | The barcode symbology to generate. |
| string | codeText | The text to encode. |
Properties
CodeText
Gets or sets the code text to encode.
Declaration
public string CodeText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
EncodeType
Gets or sets the barcode symbology.
Declaration
public BaseEncodeType EncodeType { get; set; }
Property Value
| Type | Description |
|---|---|
| BaseEncodeType |
Parameters
Gets the barcode parameters.
Declaration
public BarcodeParameters Parameters { get; }
Property Value
| Type | Description |
|---|---|
| BarcodeParameters |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GenerateBitmap()
Generates the barcode as a DRIT.Drawing.Imaging.Bitmap.
Declaration
public Bitmap GenerateBitmap()
Returns
| Type | Description |
|---|---|
| Bitmap | A bitmap containing the rendered barcode. |
GenerateImageBytes(BarCodeImageFormat)
Generates the barcode as image bytes in the specified format.
Declaration
public byte[] GenerateImageBytes(BarCodeImageFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| BarCodeImageFormat | format | The image format. |
Returns
| Type | Description |
|---|---|
| byte[] | The image bytes. |
Save(Stream, BarCodeImageFormat)
Saves the barcode to a stream in the specified format.
Declaration
public void Save(Stream stream, BarCodeImageFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The output stream. |
| BarCodeImageFormat | format | The image format. |
Save(string, BarCodeImageFormat)
Saves the barcode to a file in the specified format.
Declaration
public void Save(string filename, BarCodeImageFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The output file name. |
| BarCodeImageFormat | format | The image format. |