本文整理汇总了Java中com.google.zxing.BarcodeFormat.AZTEC属性的典型用法代码示例。如果您正苦于以下问题:Java BarcodeFormat.AZTEC属性的具体用法?Java BarcodeFormat.AZTEC怎么用?Java BarcodeFormat.AZTEC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.zxing.BarcodeFormat
的用法示例。
在下文中一共展示了BarcodeFormat.AZTEC属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encode
private static BitMatrix encode(String contents, BarcodeFormat format,
int width, int height,
Charset charset, int eccPercent, int layers) {
if (format != BarcodeFormat.AZTEC) {
throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
}
AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
return renderResult(aztec, width, height);
}
示例2: onItemSelected
/**
* Generates the chosen format from the spinner menu
*/
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String compare = parent.getItemAtPosition(position).toString();
if(compare.equals("AZTEC")){
format = BarcodeFormat.AZTEC;
}
else if(compare.equals("QR_CODE")){
format = BarcodeFormat.QR_CODE;
}
}
示例3: onItemSelected
/**
* Generates the chosen format from the spinner menu
*/
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String compare = parent.getItemAtPosition(position).toString();
if(compare.equals("AZTEC")){
format = BarcodeFormat.AZTEC;
}
else if(compare.equals("CODABAR")){
format = BarcodeFormat.CODABAR;
}
else if(compare.equals("CODE_128")){
format = BarcodeFormat.CODE_128;
}
else if(compare.equals("CODE_39")){
format = BarcodeFormat.CODE_39;
}
else if(compare.equals("EAN_13")){
format = BarcodeFormat.EAN_13;
}
else if(compare.equals("EAN_8")){
format = BarcodeFormat.EAN_8;
}
else if(compare.equals("ITF")){
format = BarcodeFormat.ITF;
}
else if(compare.equals("PDF_417")){
format = BarcodeFormat.PDF_417;
}
else if(compare.equals("QR_CODE")){
format = BarcodeFormat.QR_CODE;
}
else if(compare.equals("UPC_A")){
format = BarcodeFormat.UPC_A;
}
}
示例4: encode
private static BitMatrix encode(String contents, BarcodeFormat format, int width, int height,
Charset charset, int eccPercent, int layers) {
if (format == BarcodeFormat.AZTEC) {
return renderResult(Encoder.encode(contents.getBytes(charset), eccPercent, layers),
width, height);
}
throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
}
示例5: parseBarCodeString
/**
* Parse barcodes as BarcodeFormat constants.
*
* Supports all iOS codes except [code39mod43, itf14]
*
* Additionally supports [codabar, maxicode, rss14, rssexpanded, upca, upceanextension]
*/
private BarcodeFormat parseBarCodeString(String c) {
if ("aztec".equals(c)) {
return BarcodeFormat.AZTEC;
} else if ("ean13".equals(c)) {
return BarcodeFormat.EAN_13;
} else if ("ean8".equals(c)) {
return BarcodeFormat.EAN_8;
} else if ("qr".equals(c)) {
return BarcodeFormat.QR_CODE;
} else if ("pdf417".equals(c)) {
return BarcodeFormat.PDF_417;
} else if ("upce".equals(c)) {
return BarcodeFormat.UPC_E;
} else if ("datamatrix".equals(c)) {
return BarcodeFormat.DATA_MATRIX;
} else if ("code39".equals(c)) {
return BarcodeFormat.CODE_39;
} else if ("code93".equals(c)) {
return BarcodeFormat.CODE_93;
} else if ("interleaved2of5".equals(c)) {
return BarcodeFormat.ITF;
} else if ("codabar".equals(c)) {
return BarcodeFormat.CODABAR;
} else if ("code128".equals(c)) {
return BarcodeFormat.CODE_128;
} else if ("maxicode".equals(c)) {
return BarcodeFormat.MAXICODE;
} else if ("rss14".equals(c)) {
return BarcodeFormat.RSS_14;
} else if ("rssexpanded".equals(c)) {
return BarcodeFormat.RSS_EXPANDED;
} else if ("upca".equals(c)) {
return BarcodeFormat.UPC_A;
} else if ("upceanextension".equals(c)) {
return BarcodeFormat.UPC_EAN_EXTENSION;
} else {
android.util.Log.v("RCTCamera", "Unsupported code.. [" + c + "]");
return null;
}
}
示例6: decode
public Result decode(BinaryBitmap image, Map<DecodeHintType, ?> hints) throws
NotFoundException, FormatException {
ReaderException e;
NotFoundException notFoundException = null;
FormatException formatException = null;
Detector detector = new Detector(image.getBlackMatrix());
ResultPoint[] points = null;
DecoderResult decoderResult = null;
try {
AztecDetectorResult detectorResult = detector.detect(false);
points = detectorResult.getPoints();
decoderResult = new Decoder().decode(detectorResult);
} catch (NotFoundException e2) {
notFoundException = e2;
} catch (FormatException e3) {
formatException = e3;
}
if (decoderResult == null) {
try {
detectorResult = detector.detect(true);
points = detectorResult.getPoints();
decoderResult = new Decoder().decode(detectorResult);
} catch (ReaderException e4) {
e = e4;
if (notFoundException != null) {
throw notFoundException;
} else if (formatException == null) {
throw formatException;
} else {
throw e;
}
} catch (ReaderException e42) {
e = e42;
if (notFoundException != null) {
throw notFoundException;
} else if (formatException == null) {
throw e;
} else {
throw formatException;
}
}
}
if (hints != null) {
ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType
.NEED_RESULT_POINT_CALLBACK);
if (rpcb != null) {
for (ResultPoint point : points) {
rpcb.foundPossibleResultPoint(point);
}
}
}
Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
BarcodeFormat.AZTEC);
List<byte[]> byteSegments = decoderResult.getByteSegments();
if (byteSegments != null) {
result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
}
String ecLevel = decoderResult.getECLevel();
if (ecLevel != null) {
result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
}
return result;
}