Class Library Description
- A very simple and easy to use style to display the two-dimensional code generated by the library
- Free combination of two-dimensional code style
Usage examples
- Set the logo with round rim
Bitmap logo = BitmapFactory.decodeResource(getResources(), R.mipmap.logo); ImageView logo_iv = (ImageView) findViewById(R.id.logo_circle_space_iv); Bitmap targetBitmap = QRCodeStyle.Builder.builder() .setQr(BitmapFactory.decodeResource(getResources(), R.mipmap.qr)) .setLogo(logo) .setCircle(true) .setSpace(5) .build().get(); logo_iv.setImageBitmap(targetBitmap);
Bitmap mask = BitmapFactory.decodeResource(getResources(), R.mipmap.logo); ImageView logo_iv = (ImageView) findViewById(R.id.mask_iv); Bitmap targetBitmap = QRCodeStyle.Builder.builder() .setQr(BitmapFactory.decodeResource(getResources(), R.mipmap.qr)) .setMask(mask) .build().get(); logo_iv.setImageBitmap(targetBitmap);
Bitmap bg = BitmapFactory.decodeResource(getResources(), R.mipmap.bg); ImageView logo_iv = (ImageView) findViewById(R.id.bg_iv); Bitmap targetBitmap = QRCodeStyle.Builder.builder() .setQr(BitmapFactory.decodeResource(getResources(), R.mipmap.qr)) .setBg(bg) .build().get(); logo_iv.setImageBitmap(targetBitmap);
- All examples are shown in this class to refer to Mainactivity
GitHub Address
https://github.com/wu928320442/QRCodeStyle
Gradle Import
‘com.wjj.easy:qrcodestyle:1.0.0‘
About the author
- QQ 928320442
- Email [Email protected]
[Android Open source] a very simple and easy-to-use style to display the two-dimensional code generated by the library Qrcodestyle