當前位置: 首頁>>代碼示例>>Java>>正文


Java ErrorCorrectionLevel.H屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:areebbeigh,項目名稱:QRCodeUtility,代碼行數:27,代碼來源:HistoryObject.java

示例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;
   }
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:19,代碼來源:PrescriptionQrCodeUIBean.java


注:本文中的com.google.zxing.qrcode.decoder.ErrorCorrectionLevel.H屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。