TBarCode.NET 11 Developer Reference TBarCode.NET 11 (Windows)
TECIT.TBarCode.Barcode Class Reference

A class to draw linear and 2d barcodes. More...

Public Member Functions

 Barcode ()
 Initializes a new instance of the Barcode class.
 
float CalculateBarcodeHeight (Graphics gfx)
 Calculates the height of the barcode.
 
SizeF CalculateBarcodeSize (Graphics gfx)
 Calculates the size of the barcode.
 
float CalculateBarcodeWidth (Graphics gfx)
 Calculates the width of the barcode.
 
string CalculateCheckdigits ()
 Calculates the checkdigits.
 
float CalculateModuleWidth (Graphics gfx)
 Calculates the width of a module.
 
int CalculateNumberOfModules ()
 Calculates the number of modules.
 
int CalculateNumberOfRows ()
 Calculates the number of rows for 2d barcodes.
 
Size CalculateOptimalBitmapSize (Graphics gfx, int nScaleX, int nScaleY)
 Calculates the optimal size of a bitmap.
 
float CalculateTextAreaHeight (Graphics gfx)
 Calculates the height of the text area.
 
int CalculateXColumnsOf2DBarcode ()
 Calculates the width of the barcode in modules.
 
double CalculateXRowsOf2DBarcode ()
 Calculates the height of the barcode in modules.
 
void CopyToClipboard (int width, int height)
 Copies barcode to clipboard.
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 
void Draw (Graphics gfx)
 Draws the barcode into graphics context.
 
string Draw (ImageType imageType)
 Gets a string with the PCL, Postscript, PDF, AI or SVG drawing of the barcode.
 
void Draw (string filename, ImageType imageType)
 Draws the barcode to file.
 
void Draw (string filename, ImageType imageType, Graphics gfx)
 Draws the barcode to file with respect to a given graphics context.
 
void Draw (string filename, ImageType imageType, Graphics gfx, int quality)
 Draws the barcode to file with respect to a given graphics context.
 
void Draw (string filename, ImageType imageType, int quality)
 Draws the barcode to file.
 
Bitmap DrawBitmap ()
 Draws the barcode into a bitmap.
 
Bitmap DrawBitmap (int width, int height)
 Draws the barcode into a bitmap.
 
void DrawCustom (float width, float height)
 Calls the callback functions (events DrawRow, DrawBar, DrawText) for custom drawing.
 
Metafile DrawMetafile ()
 Draws the barcode into a meta file.
 
Metafile DrawMetafile (Graphics gfx)
 Draws the barcode into a meta file.
 
int EstimateQuality (Graphics gfx)
 Estimates the quality of a module.
 
void GetBackgroundColor (out double cyan, out double magenta, out double yellow, out double black)
 Gets the color of the background.
 
void GetBackgroundColor (out double gray)
 Gets the color of the background.
 
void GetBackgroundColor (out double red, out double green, out double blue)
 Gets the color of the background.
 
void GetBarcodeColor (out double cyan, out double magenta, out double yellow, out double black)
 Gets the color of the barcode.
 
void GetBarcodeColor (out double gray)
 Gets the color of the barcode.
 
void GetBarcodeColor (out double red, out double green, out double blue)
 Gets the color of the barcode.
 
void GetFontColor (out double cyan, out double magenta, out double yellow, out double black)
 Gets the color of the font (CMYK).
 
void GetFontColor (out double gray)
 Gets the color of the font (gray scale).
 
void GetFontColor (out double red, out double green, out double blue)
 Gets the color of the font (RGB).
 
bool IsDataValid (out Exception ex)
 Determines whether the barcode data is valid for the chosen barcode type.
 
void License (string licenseeName, LicenseType type, int numberOfLicenses, string key, TBarCodeProduct product)
 Licenses TBarCode.NET.
 
void SetBackgroundColor (double cyan, double magenta, double yellow, double black)
 Sets the color of the background.
 
void SetBackgroundColor (double gray)
 Sets the color of the background.
 
void SetBackgroundColor (double red, double green, double blue)
 Sets the color of the background.
 
void SetBarcodeColor (double cyan, double magenta, double yellow, double black)
 Sets the color of the barcode.
 
void SetBarcodeColor (double gray)
 Sets the color of the barcode.
 
void SetBarcodeColor (double red, double green, double blue)
 Sets the color of the barcode.
 
void SetFontColor (double cyan, double magenta, double yellow, double black)
 Sets the color of the font (CMYK).
 
void SetFontColor (double gray)
 Sets the color of the font (gray scale).
 
void SetFontColor (double red, double green, double blue)
 Sets the color of the font (RGB).
 
bool ShouldSerializeBackgroundColor ()
 Returns true if a designer such as Visual Studio should serialize the property BackgroundColor.
 
bool ShouldSerializeBarcodeColor ()
 Returns true if a designer such as Visual Studio should serialize the property BarcodeColor.
 
bool ShouldSerializeBoundingRectangle ()
 Returns true if a designer such as Visual Studio should serialize the property BoundingRectangle.
 
bool ShouldSerializeBoundingRectangleF ()
 Returns true if a designer such as Visual Studio should serialize the property BoundingRectangleF.
 
bool ShouldSerializeByteData ()
 Returns true if a designer such as Visual Studio should serialize the property ByteData.
 
bool ShouldSerializeFontColor ()
 Returns true if a designer such as Visual Studio should serialize the property FontColor.
 
bool ShouldSerializeIgnoreDpiFromDC ()
 Returns true if a designer such as Visual Studio should serialize the property IgnoreDpiFromDC.
 

Static Public Member Functions

static string CalculateCheckdigits (BarcodeType barcodeType, CheckdigitMethod checkdigitMethod, byte[] data)
 Calculates the checkdigits.
 
static string CalculateCheckdigits (BarcodeType barcodeType, CheckdigitMethod checkdigitMethod, string data)
 Calculates the checkdigits.
 
static string GetBarcodeNameByType (BarcodeType barcodeType)
 Gets display name for given barcode type.
 
static CheckdigitMethod[] GetCDListByType (BarcodeType barcodeType)
 Returns the implemented check-digit methods valid for given barcode symbology.
 
static string GetCheckdigitMethodName (CheckdigitMethod checkdigitMethod)
 Gets the name of the check digit method.
 
static string GetDefaultDataByType (BarcodeType barcodeType)
 Gets default data for given barcode type.
 
static int GetMaxDataLength (BarcodeType barcodeType)
 Gets the maximum length of the barcode data.
 
static int GetNumberOfBarWidths (BarcodeType barcodeType)
 Returns number of different bar-widths used by the symbology.
 
static int GetNumberOfSpaceWidths (BarcodeType barcodeType)
 Returns number of different space-widths used by the symbology.
 
static string GetRatioHint (BarcodeType barcodeType)
 Returns the format hint for the print-ratio.
 
static string GetRatioString (BarcodeType barcodeType)
 Returns the default print-ratio string of the barcode.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Disposes the specified disposing.
 

Properties

int ActiveTextIndex [get, set]
 Gets or sets the currently active text index.
 
bool AdjustModuleWidthToPixelRaster [get, set]
 Gets or sets a value indicating whether the module width should be optimized to the pixel raster.
 
Aztec Aztec [get]
 Gets the settings for Aztec Code barcodes.
 
Color BackgroundColor [get, set]
 Gets or sets the color of the background (if not transparent).
 
Color BarcodeColor [get, set]
 Gets or sets the color of the barcode.
 
BarcodeType BarcodeType [get, set]
 Gets or sets the type of the barcode.
 
BarShape BarShape [get, set]
 Gets or sets the barcode's bar shape.
 
BarShape BarShapeDefault [get]
 Gets the default bar shape for current barcode type.
 
string BarShapeImageFile [get, set]
 Gets or sets the image file used for drawing 'Image' shapes.
 
double BarWidthReduction [get, set]
 Gets or sets the bar width reduction.
 
BarWidthReductionUnit BarWidthReductionUnit [get, set]
 Gets or sets the bar width reduction unit.
 
BearerBarType BearerBarType [get, set]
 Gets or sets the bearer bar type.
 
float BearerBarWidth [get, set]
 Gets or sets the bearer bar width in [mm].
 
Rectangle BoundingRectangle [get, set]
 Gets or sets the bounding rectangle (integer version).
 
RectangleF BoundingRectangleF [get, set]
 Gets or sets the bounding rectangle (float version).
 
byte[] ByteData [get, set]
 Gets or sets the barcode data as byte array.
 
double CharacterSpacing [get, set]
 Gets or sets the character spacing distance between characters in the human readable text.
 
CheckdigitMethod CheckdigitMethod [get, set]
 Gets or sets the check digit method.
 
CodablockF CodablockF [get]
 Gets the settings for CODABLOCK F barcodes.
 
Code2Of5 Code2Of5 [get]
 Gets the settings for Code 2 of 5 barcodes.
 
CodePage Codepage [get, set]
 Gets or sets the code page used for encoding the bar code data (if set by the property Barcode.Data).
 
int CodepageCustom [get, set]
 Gets or sets a code page which does not belong to the predefined ones Barcode.Data.
 
ColorMode ColorMode [get, set]
 Gets or sets the color mode.
 
CompositeSymbol CompositeSymbol [get]
 Gets the settings for composite symbols.
 
Compression Compression [get, set]
 Gets or sets the compression mode for barcode data.
 
string Data [get, set]
 Gets or sets the barcode data.
 
DataMatrix DataMatrix [get]
 Gets the settings for Data Matrix barcodes.
 
Decoder Decoder [get, set]
 Gets or sets the type of decoder for which the barcode should be optimized.
 
DotCode DotCode [get]
 Gets the settings for DotCode barcodes.
 
double Dpi [get, set]
 Gets or sets the resolution in dpi.
 
EncodingMode EncodingMode [get, set]
 Gets or sets the encoding mode of the input data (Data, ByteData).
 
Font Font [get, set]
 Sets the font of the currently active text object (usually the human readable text).
 
Color FontColor [get, set]
 Gets or sets the font color of the HRT (font object).
 
int FontHeight [get, set]
 Gets the font size [points] of the currently active text object (usually the human readable text).
 
string FontName [get, set]
 Sets the font of the currently active text object (usually the human readable text).
 
string Format [get, set]
 Gets or sets the format string.
 
GdiDrawingMethod GdiDrawingMode [get, set]
 Gets or sets the GDI drawing mode.
 
IntPtr Handle [get]
 Get the handle to the internal bar code structure.
 
HanXin HanXin [get]
 Gets the settings for Han Xin barcodes.
 
string HumanReadableText [get, set]
 Gets or sets the content of the currently active text object (usually the human readable text).
 
bool IgnoreDpiFromDC [get, set]
 Gets or sets a value indicating whether to ignore the resolution of the device context.
 
bool IncludeMacrosInPostscript [get, set]
 Gets or sets a value indicating whether Postscript macros should be included in Postscript output.
 
bool IsBackgroundTransparent [get, set]
 Gets or sets a value indicating whether the background is transparent or filled with the background color.
 
bool IsMirrored [get, set]
 Gets or sets a value indicating whether this barcode is drawn mirrored.
 
bool IsPositionRelative [get, set]
 Gets or sets a value indicating whether the barcode position is relative.
 
bool IsTextAbove [get, set]
 Determines if human-readable text is printed below or above the barcode.
 
bool IsTextVisible [get, set]
 Determines if the currently active text object (usually the human readable text) is visible.
 
static string LibraryDate [get]
 Gets the TBarCode DLL / Library build date.
 
static string LibraryVersion [get]
 Gets the TBarCode DLL / Library version.
 
int LicenseCount [get, set]
 Gets or sets the number of licenses.
 
TBarCodeProduct LicensedProduct [get, set]
 Gets or sets the licensed product.
 
string Licensee [get, set]
 Gets or sets the name of the licensee.
 
string LicenseKey [set]
 Gets or sets the license key.
 
LicenseType LicenseType [get, set]
 Gets or sets the license type.
 
MaxiCode MaxiCode [get]
 Gets the settings for MaxiCode barcodes.
 
static int MaximumTextIndex [get]
 Gets the maximum index of available text objects.
 
MicroQRCode MicroQRCode [get]
 Gets the settings for Micro QR Code barcodes.
 
double ModuleWidth [get, set]
 Gets or sets the width of a module or dot in [mm].
 
bool MustFit [get, set]
 Gets or sets a value indicating whether the barcode must fit into the bounding rectangle.
 
bool NormalizeDC [get, set]
 Gets or sets a value indicating whether the drawing context (DC) should be normalized internally.
 
float NotchHeight [get, set]
 Gets or sets the notch height (the protrusion of the synchronization bars - applies to EAN-13, UPC-A and variants).
 
static int NumberOfBarcodeTypes [get]
 Gets the number of barcode types.
 
static int NumberOfCheckdigitMethods [get]
 Gets the number of supported check digit methods.
 
string Options [get, set]
 Gets or sets the barcode option string.
 
PclMode PclMode [get, set]
 Gets or sets the PCL mode.
 
Pdf417 Pdf417 [get]
 Gets the settings for PDF417, Macro PDF417 and MicroPDF417 barcodes.
 
static string PostscriptMacros [get]
 Gets the postscript macros.
 
QRCode QRCode [get]
 Gets the settings for QR Code barcodes.
 
QuietZones QuietZones [get]
 Gets the quiet zone settings.
 
string Ratio [get, set]
 Gets or sets the ratio of bar and gap widths in the barcode.
 
Rotation Rotation [get, set]
 Gets or sets the rotation.
 
Rss Rss [get]
 Gets the settings for GS1 DataBar/Rss barcodes.
 
SizeMode SizeMode [get, set]
 Gets or sets the size mode.
 
Alignment TextAlignment [get, set]
 Gets or sets the alignment of the currently active text object (usually the human readable text).
 
int TextBlockHeight [get, set]
 Gets or sets the height of the currently active 's text bounding rectangle.
 
int TextBlockWidth [get, set]
 Gets or sets the width of the currently active 's text bounding rectangle.
 
bool TextClipping [get, set]
 Determines if the currently active text object is clipped.
 
float TextDistance [get, set]
 Gets or sets the distance between the human readable text and the barcode in [mm].
 
RectangleF TextPosition [get, set]
 Gets or sets the position of the currently active text object.
 
int TextPositionLeft [get, set]
 Gets or sets the left edge of the currently active 's text bounding rectangle.
 
int TextPositionTop [get, set]
 Gets or sets the top edge of the currently active 's text bounding rectangle.
 
Rotation TextRotation [get, set]
 Gets or sets the the rotation of the currently active text object.
 
bool TranslateEscapeSequences [get, set]
 Gets or sets a value indicating whether escapes sequences are translated in the bar code data.
 
TrimWhiteSpaces TrimWhiteSpaces [get, set]
 Determine whether and how to trim whitespaces from the barcode data.
 
bool UseDeviceFonts [get, set]
 Gets or sets a value indicating whether device fonts should be used for Postscript output.
 
static string Version [get]
 Gets the TBarCode.NET product version.
 
bool WordWrapping [get, set]
 [NOT IMPLEMENTED YET!] Determines if word wrapping is enabled for the currently active text object (usually the human readable text).
 

Events

EventHandler< CustomDrawingEventArgsDrawBar
 Occurs when a bar is drawn in DrawCustom.
 
EventHandler< CustomDrawingEventArgsDrawColoredBar
 Occurs when a colored bar is drawn in DrawCustom.
 
EventHandler< CustomDrawingEventArgsDrawHexagon
 Occurs when a MaxiCode Hexagon is drawn in DrawCustom.
 
EventHandler< CustomDrawingEventArgsDrawRing
 Occurs when a MaxiCode Ring is drawn in DrawCustom.
 
EventHandler< CustomDrawingEventArgsDrawRow
 Occurs when a row of bars is drawn in DrawCustom.
 
EventHandler< CustomDrawingEventArgsDrawText
 Occurs when the human readable text is drawn in DrawCustom.
 

Detailed Description

A class to draw linear and 2d barcodes.


© 2024 All rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Tue Mar 26 2024 20:14:47 for TBarCode.NET 11 Developer Reference with doxygen 1.9.8