Package | ardisia.components.barCode |
Class | public class BarCode |
Inheritance | BarCode spark.components.Group |
Generally, this component does not validate the encoded data. It is up to the developer to ensure data is of the correct format before feeding it to this class for encoding. This component does not manage quiet zones. See the specification files for some notes on required quiet zone widths.
Explicit dimensions will work, but it is recommended to use measured dimensions because in that case encoded data will be displayed using whole pixels. Explicit dimensions may use partial pixels and therefore be harder for barcode readers to decode. To control the relative size of measured bar codes, use the "resolution" property.
For the 1-D barcodes (with measured dimensions), the line width is determined directly by the "resolution" property which in turn determines the measured width.
In summary, explicit dimensions are allowed, but this may cause partial pixels to be drawn and therefore be harder for a barcode reader to read. Use measured dimensions and control the relative size via the "resolution" property.
View the technical documentation on the Ardisia Labs website for more information.
Default MXML PropertymxmlContent
Property | Defined By | ||
---|---|---|---|
barColor : Number
The color of the bar code rectangles/lines. | BarCode | ||
resolution : int
Resolution to draw data in the bar code. | BarCode | ||
type : String
Set the type of barcode to generate. | BarCode | ||
value : String
The value to encode. | BarCode |
Method | Defined By | ||
---|---|---|---|
generateEncoding():void
Creates the encoded string or image. | BarCode |
barColor | property |
barColor:Number
The color of the bar code rectangles/lines.
The default value is 0x000000
.
public function get barColor():Number
public function set barColor(value:Number):void
resolution | property |
resolution:int
Resolution to draw data in the bar code.
Sets the thickness of each vertical line drawn on screen.
Adjust to make the bar code wider and/or smaller. Minimum of 1.
The default value is 2
.
public function get resolution():int
public function set resolution(value:int):void
type | property |
type:String
Set the type of barcode to generate.
The default value is "codabar"
.
This property can be used as the source for data binding.
public function get type():String
public function set type(value:String):void
value | property |
value:String
The value to encode. Not validated for a particular bar code type.
The default value is undefined
.
This property can be used as the source for data binding.
public function get value():String
public function set value(value:String):void
generateEncoding | () | method |
protected function generateEncoding():void
Creates the encoded string or image.