[]
        
(Showing Draft Content)

GrapeCity.Documents.Barcode.GcBarcode

Class GcBarcode

Namespace
GrapeCity.Documents.Barcode
Assembly
GcDocs.Barcode.dll

Represents a barcode that can be drawn on a GcGraphics. The supported barcode types are represented by the CodeType enum.

public class GcBarcode
Inheritance
object
GcBarcode
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

GcBarcode()

Initializes a new instance of the GcBarcode class.

public GcBarcode()

Properties

CodeType

Gets or sets the barcode encoding. The default is Code39.

public CodeType CodeType { get; set; }

Property Value

CodeType

HorizontalAlignment

Gets or sets the horizontal alignment of the barcode.

public ImageAlignHorz HorizontalAlignment { get; set; }

Property Value

ImageAlignHorz

Options

Gets the BarcodeOptions object defining the barcode.

public BarcodeOptions Options { get; }

Property Value

BarcodeOptions

ScaleFactor

Gets or sets the scale factor applied to the barcode image and caption. The default is 1, larger values increase the barcode size, lesser decrease.

public float ScaleFactor { get; set; }

Property Value

float

Text

Gets or sets the value that is encoded by the barcode.

public string Text { get; set; }

Property Value

string

TextFormat

Gets or sets the text format used to draw the barcode label.

public TextFormat TextFormat { get; set; }

Property Value

TextFormat

VerticalAlignment

Gets or sets the vertical alignment of the barcode.

public ImageAlignVert VerticalAlignment { get; set; }

Property Value

ImageAlignVert

Methods

GetCaption()

Gets the barcode caption. In some cases this may differ from the encoded value.

public string GetCaption()

Returns

string

The barcode caption.

ToGcBitmap(int, bool)

Renders the current barcode into a new instance of GcBitmap with the specified resolution. It is the responsibility of the caller to dispose the returned bitmap after use.

Note that when the bitmap is drawn on a GcPdfGraphics, it must not be disposed until after the target PDF is saved.

public GcBitmap ToGcBitmap(int dpi = 300, bool aliased = false)

Parameters

dpi int

The resolution of the generated bitmap.

aliased bool

Whether the barcode is drawn without anti-aliasing

Returns

GcBitmap

The newly created GcBitmap containing the image of the barcode.