本文整理匯總了Java中com.google.zxing.qrcode.decoder.ErrorCorrectionLevel.H屬性的典型用法代碼示例。如果您正苦於以下問題:Java ErrorCorrectionLevel.H屬性的具體用法?Java ErrorCorrectionLevel.H怎麽用?Java ErrorCorrectionLevel.H使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
的用法示例。
在下文中一共展示了ErrorCorrectionLevel.H屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBitmap
/**
* Returns a bitmap of the QR Code
*/
public Bitmap getBitmap() throws WriterException {
String eclString = getEcl();
ErrorCorrectionLevel ecl;
switch (eclString) {
case "M":
ecl = ErrorCorrectionLevel.M;
break;
case "Q":
ecl = ErrorCorrectionLevel.Q;
break;
case "H":
ecl = ErrorCorrectionLevel.H;
break;
default:
ecl = ErrorCorrectionLevel.L;
break;
}
Map<EncodeHintType, Object> hints = new EnumMap<>(EncodeHintType.class);
hints.put(EncodeHintType.ERROR_CORRECTION, ecl);
return getAsQRCodeObject().getSimpleBitmap(foreground, hints);
}
示例2: getEcLevel
/**
* This method is required and is coded funny because XING - the library we're using,
* decided not to use enum's for the ec levels because they wanted to support
* jdk 1.4 which doesn't have enums. As a result we manuallt valueOf the property.
*
* We need to return the static instances just in case XING decided to do what java-enums
* do when checking equality - which is to check the in memory class instance value since
* enums are defined as singletons.
*/
private static ErrorCorrectionLevel getEcLevel() {
String ecLevelString=OscarProperties.getInstance().getProperty("QR_CODE_ERROR_CORRECTION_LEVEL");
if ("L".equals(ecLevelString)) return(ErrorCorrectionLevel.L);
if ("M".equals(ecLevelString)) return(ErrorCorrectionLevel.M);
if ("Q".equals(ecLevelString)) return(ErrorCorrectionLevel.Q);
if ("H".equals(ecLevelString)) return(ErrorCorrectionLevel.H);
return null;
}