C# Class ZXing.OneD.OneDimensionalCodeWriter

Encapsulates functionality and implementation that is common to one-dimensional barcodes.

[email protected] (Kazuki Nishiura)
Inheritance: Writer
ファイルを表示 Open project: Redth/ZXing.Net.Mobile

Public Methods

Method Description
CalculateChecksumDigitModulo10 ( String contents ) : String

Calculates the checksum digit modulo10.

encode ( String contents, BarcodeFormat format, int width, int height ) : BitMatrix

Encode a barcode using the default settings.

encode ( String contents, BarcodeFormat format, int width, int height, object>.IDictionary hints ) : BitMatrix

Encode the contents following specified format. {@code width} and {@code height} are required size. This method may return bigger size {@code BitMatrix} when specified size is too small. The user can set both {@code width} and {@code height} to zero to get minimum size barcode. If negative value is set to {@code width} or {@code height}, {@code IllegalArgumentException} is thrown.

encode ( String contents ) : bool[]

Encode the contents to bool array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.

Protected Methods

Method Description
appendPattern ( bool target, int pos, int pattern, bool startColor ) : int

Appends the given pattern to the target array starting at pos.

Private Methods

Method Description
renderResult ( bool code, int width, int height, int sidesMargin ) : BitMatrix

Method Details

CalculateChecksumDigitModulo10() public static method

Calculates the checksum digit modulo10.
public static CalculateChecksumDigitModulo10 ( String contents ) : String
contents String The contents.
return String

appendPattern() protected static method

Appends the given pattern to the target array starting at pos.
protected static appendPattern ( bool target, int pos, int pattern, bool startColor ) : int
target bool encode black/white pattern into this array
pos int position to start encoding at in target
pattern int lengths of black/white runs to encode
startColor bool starting color - false for white, true for black
return int

encode() public method

Encode a barcode using the default settings.
public encode ( String contents, BarcodeFormat format, int width, int height ) : BitMatrix
contents String The contents to encode in the barcode
format BarcodeFormat The barcode format to generate
width int The preferred width in pixels
height int The preferred height in pixels
return ZXing.Common.BitMatrix

encode() public method

Encode the contents following specified format. {@code width} and {@code height} are required size. This method may return bigger size {@code BitMatrix} when specified size is too small. The user can set both {@code width} and {@code height} to zero to get minimum size barcode. If negative value is set to {@code width} or {@code height}, {@code IllegalArgumentException} is thrown.
public encode ( String contents, BarcodeFormat format, int width, int height, object>.IDictionary hints ) : BitMatrix
contents String
format BarcodeFormat
width int
height int
hints object>.IDictionary
return ZXing.Common.BitMatrix

encode() public abstract method

Encode the contents to bool array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.
public abstract encode ( String contents ) : bool[]
contents String barcode contents to encode
return bool[]