Back to Zxing

Class MultiFormatWriter

docs/apidocs/com/google/zxing/MultiFormatWriter.html

latest3.3 KB
Original Source

Package com.google.zxing

Class MultiFormatWriter

java.lang.Object com.google.zxing.MultiFormatWriter

All Implemented Interfaces:Writer


public final class MultiFormatWriterextends Object implements Writer

This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat requested and encodes the barcode with the supplied contents. Author:[email protected] (Daniel Switkin)

Constructor Summary

Constructors

Constructor

Description

MultiFormatWriter()

Method Summary

All MethodsInstance MethodsConcrete Methods

Modifier and Type

Method

Description

BitMatrix

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

Encode a barcode using the default settings.

BitMatrix

encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType,?> hints)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MultiFormatWriter

public MultiFormatWriter()

Method Details

encode

public BitMatrix encode(String contents, BarcodeFormat format, int width, int height) throws WriterException

Description copied from interface: Writer

Encode a barcode using the default settings. Specified by:encode in interface WriterParameters:contents - The contents to encode in the barcodeformat - The barcode format to generatewidth - The preferred width in pixelsheight - The preferred height in pixelsReturns:BitMatrix representing encoded barcode imageThrows:WriterException - if contents cannot be encoded legally in a format

encode

public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType,?> hints) throws WriterException Specified by:encode in interface WriterParameters:contents - The contents to encode in the barcodeformat - The barcode format to generatewidth - The preferred width in pixelsheight - The preferred height in pixelshints - Additional parameters to supply to the encoderReturns:BitMatrix representing encoded barcode imageThrows:WriterException - if contents cannot be encoded legally in a format