Coder Social home page Coder Social logo

android-qrcodetools's Introduction

android-qrcodetools

生成二维码和二维码图片识别工具(nextqrcode 代码copy过来,移除了扫描的功能) 如需扫描请查看扫描效率更高的android-qrcodescan

NextQRCode ZXing开源库的精简版

基于ZXing Android实现的二维码扫描支持库。 包括生成二维码图片解析二维码图片相机扫描即时解码三部分功能。

与原ZXingMini项目对比

NextQRCode做了重大架构修改,原ZXingMini项目与当前NextQRCode不兼容

依赖

dependencies {
    compile 'tech.wangjie:qrcodetools:1.0.0'
    ...
}

生成二维码图案

// 二维码中间图标
final Bitmap centerImage = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
// 生成的二维码图案
Bitmap qrCodeImage = new QRCodeEncoder.Builder()
        .width(size) // 二维码图案的宽度
        .height(size)
        .paddingPx(0) // 二维码的内边距
        .marginPt(3) // 二维码的外边距
        .centerImage(centerImage) // 二维码中间图标
        .build()
        .encode(content);

二维码解码

final QRCodeDecoder mDecoder = new QRCodeDecoder.Builder().build();
// 传入二维码图案Bitmap对象然后解码成文本内容
String content = mDecoder.decode(bitmap);

实例

image

android-qrcodetools's People

Contributors

djonce avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.