红鱼儿

ChinaCock界面控件介绍-TCCBarcodeCreator

条码生成器,可以生成各种条码,包括二维码。这是一个不可视控件。用起来依旧简单。

属性说明:

BarCodeColor:生成条码的颜色

BarcodeFormat:生成条码的类型,支持的条码类型:

BottomText:底部的文字

BottomTextColor:底部文字的颜色

BottomTextLinePaddiung:

BottomTextPadding:

BottomTextSize:

Code:条码的内容

ImageHeight:

ImageWidth:

IncludeLogo:

LogoBitmap:

ShowBottomText:是否显示底部文字

下面是生成一个二维码的代码:

BarcodeCreator.BarcodeFormat:=TCCBarcodeFormat.QR_CODE;
BarcodeCreator.Code:=edtCode.Text;
BarcodeCreator.BarcodeColor:=cbxBarcodeColor.Color;
BarcodeCreator.ImageWidth:=300;
BarcodeCreator.ImageHeight:=300;
BarcodeCreator.LogoBitmap:=self.LogoImage.Bitmap;
BarcodeCreator.IncludeLogo:=self.chxIncludeLogo.IsChecked;
BarcodeCreator.ShowBottomText:=chxShowBottomTex.IsChecked;
BarcodeCreator.BottomText:=self.edtBottomText.Text;
BarcodeCreator.BottomTextColor:=TAlphaColors.Red;
BarcodeCreator.BottomTextSize:=20;
BarcodeCreator.BottomTextPadding:=20;
BarcodeCreator.BottomTextlinePadding:=10;

self.BarcodeImage.Bitmap:=BarcodeCreator.CreateBarcode;//生成二维码图片

简单的都没什么可写的了。

下图是我实际的案例,把app的下载地址生成二维码:

 

2020-06-22

delphi 10.3.3使用这个控件,进入app闪退,经作者提示,需要发布google-core-3.3.1.jar。

下面是闪退后捕获的日志:

06-22 10:51:53.097 18817 18817 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
06-22 10:51:53.098 18817 18817 W BufferQueueProducer: [SurfaceTexture-0-18817-0]:1368: disconnect: not connected (req=1)
06-22 10:51:53.098 18817 18817 W libEGL  : EGLNativeWindowType 0xbd56c008 disconnect failed
06-22 10:51:53.116 18817 18817 D HwGalleryCacheManagerImpl: mIsEffect:false
06-22 10:51:53.142 18817 18817 W System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/zxing/MultiFormatWriter;
06-22 10:51:53.142 18817 18817 W System.err: 	at com.chinacock.ccfmx.CCBarcodeCreator.<init>(CCBarcodeCreator.java:58)
06-22 10:51:53.142 18817 18817 W System.err: 	at android.app.NativeActivity.onStartNative(Native Method)
06-22 10:51:53.142 18817 18817 W System.err: 	at android.app.NativeActivity.onStart(NativeActivity.java:235)
06-22 10:51:53.142 18817 18817 W System.err: 	at com.embarcadero.firemonkey.FMXNativeActivity.onStart(FMXNativeActivity.java:234)
06-22 10:51:53.142 18817 18817 W System.err: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1447)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.Activity.performStart(Activity.java:8108)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3919)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:235)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:215)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:187)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2473)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:110)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.os.Looper.loop(Looper.java:219)
06-22 10:51:53.143 18817 18817 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:8347)
06-22 10:51:53.143 18817 18817 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
06-22 10:51:53.143 18817 18817 W System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
06-22 10:51:53.143 18817 18817 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
06-22 10:51:53.143 18817 18817 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.zxing.MultiFormatWriter" on path: DexPathList[[zip file "/data/app/com.embarcadero.Project2-2xZx-tMQzwe8ppj6btoxhw==/base.apk"],nativeLibraryDirectories=[/data/app/com.embarcadero.Project2-2xZx-tMQzwe8ppj6btoxhw==/lib/arm, /data/app/com.embarcadero.Project2-2xZx-tMQzwe8ppj6btoxhw==/base.apk!/lib/armeabi-v7a, /system/lib, /hw_product/lib]]
06-22 10:51:53.143 18817 18817 W System.err: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:209)
06-22 10:51:53.143 18817 18817 W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
06-22 10:51:53.143 18817 18817 W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
06-22 10:51:53.143 18817 18817 W System.err: 	... 18 more
06-22 10:51:53.150  1322  2561 D RemoteAnimationController: app

有朋友问怎么发布这个google-core-3.3.1.jar:
1.在项目管理器窗口,右键,如下图,选择Add

 

 

 2.google-core-3.3.1.jar在作者的组件目.\ChinaCock\FMX\sdk

 

 

 就这样发布了!

 

posted on 2019-03-26 07:58  红鱼儿  阅读(1188)  评论(0编辑  收藏  举报