Manual - Barcode 2D

Introduction

This class is an abstract class that contains the base methods to create 2D barcodes only.

This class inherits the BakeryBarcode class.

Methods

BakeryBarcode2D's Methods

BakeryBarcode's Methods

Code Example


// To get an example on how to use this class, check barcode classes.

Method explanations

  • scaleX={scaleX} — Sets the scaling X for the barcode
    Description
    The width in pixel of one module.
    The default value is 1.
    Note that this method is protected.
  • scaleY={scaleY} — Sets the scaling Y for the barcode
    Description
    The height in pixel of one module.
    The default value is 1.
    Note that this method is protected.
  • text={text} — Analyzes a text message to draw afterwards
    Description
    The data you pass to the text argument must be supported by the type of barcode you use.
    Check each barcode's introduction section to obtain more information on how to use this method within each symbology.
  • scale={scale} — Sets the scale of the barcode
    Description
    The barcode will be x times bigger. Then a pixel will be x by x for its size.
  • foregroundColor={color} — Sets the color of the bars
    Description
    Sets the color of the bars of the barcode. By default, the color is black. This argument can be a BakeryColor class or any other argument that BakeryColor can accept in its constructor.
  • backgroundColor={color} — Sets the color of the spaces
    Description
    Sets the color of the spaces of the barcode. By default, the color is white. This argument can be a BakeryColor class or any other argument that BakeryColor can accept in its constructor.
  • offsetX={value} — Sets the X offset
    Description
    Specifies the X offset of the barcode in pixels multiplied by the scale.
  • offsetY={value} — Sets the Y offset
    Description
    Specifies the Y offset of the barcode in pixels multiplied by the scale.