当前位置: 首页>>代码示例>>Java>>正文


Java PDF417.generateBarcodeLogic方法代码示例

本文整理汇总了Java中com.google.zxing.pdf417.encoder.PDF417.generateBarcodeLogic方法的典型用法代码示例。如果您正苦于以下问题:Java PDF417.generateBarcodeLogic方法的具体用法?Java PDF417.generateBarcodeLogic怎么用?Java PDF417.generateBarcodeLogic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.pdf417.encoder.PDF417的用法示例。


在下文中一共展示了PDF417.generateBarcodeLogic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
/**
 * Takes encoder, accounts for width/height, and retrieves bit matrix
 */
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder,
                                              String contents,
                                              int errorCorrectionLevel,
                                              int width,
                                              int height,
                                              int margin) throws WriterException {
  encoder.generateBarcodeLogic(contents, errorCorrectionLevel);

  int aspectRatio = 4;
  byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(1, aspectRatio);
  boolean rotated = false;
  if ((height > width) ^ (originalScale[0].length < originalScale.length)) {
    originalScale = rotateArray(originalScale);
    rotated = true;
  }

  int scaleX = width / originalScale[0].length;
  int scaleY = height / originalScale.length;

  int scale;
  if (scaleX < scaleY) {
    scale = scaleX;
  } else {
    scale = scaleY;
  }

  if (scale > 1) {
    byte[][] scaledMatrix =
        encoder.getBarcodeMatrix().getScaledMatrix(scale, scale * aspectRatio);
    if (rotated) {
      scaledMatrix = rotateArray(scaledMatrix);
    }
    return bitMatrixFrombitArray(scaledMatrix, margin);
  }
  return bitMatrixFrombitArray(originalScale, margin);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:40,代码来源:PDF417Writer.java

示例2: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder, String contents, int
        errorCorrectionLevel, int width, int height, int margin) throws WriterException {
    int i;
    int scale;
    encoder.generateBarcodeLogic(contents, errorCorrectionLevel);
    byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(1, 4);
    boolean rotated = false;
    int i2 = height > width ? 1 : 0;
    if (originalScale[0].length < originalScale.length) {
        i = 1;
    } else {
        i = 0;
    }
    if ((i2 ^ i) != 0) {
        originalScale = rotateArray(originalScale);
        rotated = true;
    }
    int scaleX = width / originalScale[0].length;
    int scaleY = height / originalScale.length;
    if (scaleX < scaleY) {
        scale = scaleX;
    } else {
        scale = scaleY;
    }
    if (scale <= 1) {
        return bitMatrixFrombitArray(originalScale, margin);
    }
    byte[][] scaledMatrix = encoder.getBarcodeMatrix().getScaledMatrix(scale, scale * 4);
    if (rotated) {
        scaledMatrix = rotateArray(scaledMatrix);
    }
    return bitMatrixFrombitArray(scaledMatrix, margin);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:34,代码来源:PDF417Writer.java

示例3: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
/**
 * Takes encoder, accounts for width/height, and retrieves bit matrix
 */
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder,
                                              String contents,
                                              int width,
                                              int height,
                                              int margin) throws WriterException {
  int errorCorrectionLevel = 2;
  encoder.generateBarcodeLogic(contents, errorCorrectionLevel);

  int lineThickness = 2;
  int aspectRatio = 4;
  byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(lineThickness, aspectRatio * lineThickness);
  boolean rotated = false;
  if ((height > width) ^ (originalScale[0].length < originalScale.length)) {
    originalScale = rotateArray(originalScale);
    rotated = true;
  }

  int scaleX = width / originalScale[0].length;
  int scaleY = height / originalScale.length;

  int scale;
  if (scaleX < scaleY) {
    scale = scaleX;
  } else {
    scale = scaleY;
  }

  if (scale > 1) {
    byte[][] scaledMatrix =
        encoder.getBarcodeMatrix().getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness);
    if (rotated) {
      scaledMatrix = rotateArray(scaledMatrix);
    }
    return bitMatrixFrombitArray(scaledMatrix, margin);
  }
  return bitMatrixFrombitArray(originalScale, margin);
}
 
开发者ID:SudarAbisheck,项目名称:ZXing-Orient,代码行数:41,代码来源:PDF417Writer.java

示例4: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
/**
 * Takes encoder, accounts for width/height, and retrieves bit matrix
 */
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder,
                                              String contents,
                                              int width,
                                              int height,
                                              int margin) throws WriterException {
    int errorCorrectionLevel = 2;
    encoder.generateBarcodeLogic(contents, errorCorrectionLevel);

    int lineThickness = 2;
    int aspectRatio = 4;
    byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(lineThickness, aspectRatio * lineThickness);
    boolean rotated = false;
    if ((height > width) ^ (originalScale[0].length < originalScale.length)) {
        originalScale = rotateArray(originalScale);
        rotated = true;
    }

    int scaleX = width / originalScale[0].length;
    int scaleY = height / originalScale.length;

    int scale;
    if (scaleX < scaleY) {
        scale = scaleX;
    } else {
        scale = scaleY;
    }

    if (scale > 1) {
        byte[][] scaledMatrix =
                encoder.getBarcodeMatrix().getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness);
        if (rotated) {
            scaledMatrix = rotateArray(scaledMatrix);
        }
        return bitMatrixFrombitArray(scaledMatrix, margin);
    }
    return bitMatrixFrombitArray(originalScale, margin);
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:41,代码来源:PDF417Writer.java

示例5: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
/**
 * Takes encoder, accounts for width/height, and retrieves bit matrix
 */
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder,
                                              String contents,
                                              int width,
                                              int height) throws WriterException {
    int errorCorrectionLevel = 2;
    encoder.generateBarcodeLogic(contents, errorCorrectionLevel);

    int lineThickness = 2;
    int aspectRatio = 4;
    byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(lineThickness, aspectRatio * lineThickness);
    boolean rotated = false;
    if ((height > width) ^ (originalScale[0].length < originalScale.length)) {
        originalScale = rotateArray(originalScale);
        rotated = true;
    }

    int scaleX = width / originalScale[0].length;
    int scaleY = height / originalScale.length;

    int scale;
    if (scaleX < scaleY) {
        scale = scaleX;
    } else {
        scale = scaleY;
    }

    if (scale > 1) {
        byte[][] scaledMatrix =
                encoder.getBarcodeMatrix().getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness);
        if (rotated) {
            scaledMatrix = rotateArray(scaledMatrix);
        }
        return bitMatrixFrombitArray(scaledMatrix);
    }
    return bitMatrixFrombitArray(originalScale);
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:40,代码来源:PDF417Writer.java

示例6: bitMatrixFromEncoder

import com.google.zxing.pdf417.encoder.PDF417; //导入方法依赖的package包/类
/**
 * Takes encoder, accounts for width/height, and retrieves bit matrix
 */
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder,
                                              String contents,
                                              int width,
                                              int height) throws WriterException {
  int errorCorrectionLevel = 2;
  encoder.generateBarcodeLogic(contents, errorCorrectionLevel);

  int lineThickness = 2;
  int aspectRatio = 4;
  byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(lineThickness, aspectRatio * lineThickness);
  boolean rotated = false;
  if ((height > width) ^ (originalScale[0].length < originalScale.length)) {
    originalScale = rotateArray(originalScale);
    rotated = true;
  }

  int scaleX = width / originalScale[0].length;
  int scaleY = height / originalScale.length;

  int scale;
  if (scaleX < scaleY) {
    scale = scaleX;
  } else {
    scale = scaleY;
  }

  if (scale > 1) {
    byte[][] scaledMatrix =
        encoder.getBarcodeMatrix().getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness);
    if (rotated) {
      scaledMatrix = rotateArray(scaledMatrix);
    }
    return bitMatrixFrombitArray(scaledMatrix);
  }
  return bitMatrixFrombitArray(originalScale);
}
 
开发者ID:yinglovezhuzhu,项目名称:ZxingCore,代码行数:40,代码来源:PDF417Writer.java


注:本文中的com.google.zxing.pdf417.encoder.PDF417.generateBarcodeLogic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。