CodeUtils

class CodeUtils

二维码/条形码工具类:主要包括二维码/条形码的解析与生成

Author

Jenly

Follow me

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun createBarCode(@NonNull content: String, desiredWidth: Int, desiredHeight: Int): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int, @Nullable hints: Map<EncodeHintType, out Any>): Bitmap
open fun createBarCode(@NonNull content: String, desiredWidth: Int, desiredHeight: Int, isShowText: Boolean, @ColorInt codeColor: Int): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int, isShowText: Boolean, @ColorInt codeColor: Int): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int, @Nullable hints: Map<EncodeHintType, out Any>, isShowText: Boolean): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int, @Nullable hints: Map<EncodeHintType, out Any>, isShowText: Boolean, @ColorInt codeColor: Int): Bitmap
open fun createBarCode(@NonNull content: String, @NonNull format: BarcodeFormat, desiredWidth: Int, desiredHeight: Int, @Nullable hints: Map<EncodeHintType, out Any>, isShowText: Boolean, textSize: Int, @ColorInt codeColor: Int): Bitmap
生成条形码
open fun createBarCode(@NonNull content: String, desiredWidth: Int, desiredHeight: Int, isShowText: Boolean): Bitmap
Link copied to clipboard
open fun createQRCode(@NonNull content: String, size: Int): Bitmap
open fun createQRCode(@NonNull content: String, size: Int, @ColorInt codeColor: Int): Bitmap
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap, @FloatRange(from = 0.0, to = 1.0) ratio: Float): Bitmap
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap, @FloatRange(from = 0.0, to = 1.0) ratio: Float, @ColorInt codeColor: Int): Bitmap
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap, @FloatRange(from = 0.0, to = 1.0) ratio: Float, @Nullable hints: Map<EncodeHintType, out Any>, @ColorInt codeColor: Int): Bitmap
生成二维码
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap): Bitmap
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap, @ColorInt codeColor: Int): Bitmap
生成我二维码
open fun createQRCode(@NonNull content: String, size: Int, @Nullable logo: Bitmap, @FloatRange(from = 0.0, to = 1.0) ratio: Float, @Nullable hints: Map<EncodeHintType, out Any>): Bitmap
Link copied to clipboard
open fun parseCode(@NonNull bitmap: Bitmap): String
open fun parseCode(@NonNull bitmapPath: String): String
open fun parseCode(@NonNull bitmap: Bitmap, @Nullable hints: Map<DecodeHintType, Any>): String
open fun parseCode(@NonNull bitmapPath: String, @Nullable hints: Map<DecodeHintType, Any>): String
解析一维码/二维码图片
Link copied to clipboard
open fun parseCodeResult(@NonNull bitmap: Bitmap): Result
open fun parseCodeResult(@NonNull bitmap: Bitmap, @Nullable hints: Map<DecodeHintType, Any>): Result
open fun parseCodeResult(source: LuminanceSource, @Nullable hints: Map<DecodeHintType, Any>): Result
open fun parseCodeResult(@NonNull bitmapPath: String, @Nullable hints: Map<DecodeHintType, Any>): Result
open fun parseCodeResult(@NonNull bitmapPath: String, reqWidth: Int, reqHeight: Int, @Nullable hints: Map<DecodeHintType, Any>): Result
解析一维码/二维码图片
Link copied to clipboard
open fun parseQRCode(@NonNull bitmapPath: String): String
解析二维码图片
Link copied to clipboard
open fun parseQRCodeResult(@NonNull bitmapPath: String): Result
open fun parseQRCodeResult(@NonNull bitmapPath: String, reqWidth: Int, reqHeight: Int): Result
解析二维码图片