zxing

解决zxing的IntentIntegrator在使用setRequestCode时获取不到结果的问题

。_饼干妹妹 提交于 2020-08-13 16:08:13
在生产线组装时一个界面上可能需要同时扫多个码来绑定产品信息,所以想到用自定义的 requestCode 来区分,代码如下: @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if (result != null) { if (result.getContents() == null) { Toast.makeText(this, "你已经放弃了扫描", Toast.LENGTH_LONG).show(); } else { switch (requestCode) { case REQUEST_CODE_IMEI: etImei.setText(result.getContents()); break; case REQUEST_CODE_ASSET_NO: etAssetNo.setText(result.getContents()); break; default: etDeviceNo.setText(result.getContents()); }

WPF打印二维码和条形码

北慕城南 提交于 2020-08-11 18:08:57
使用ZXing.net生成二维码和一维码图片,再使用PrintDocument打印图片 具体代码: private string GenerateBarCodeImage( string barCode, int width, int height, BarcodeFormat format) { BarcodeWriter writer = new BarcodeWriter { Format = format }; QrCodeEncodingOptions options = new QrCodeEncodingOptions(); // 设置内容编码 options.CharacterSet = " UTF-8 " ; // 设置二维码的宽度和高度 options.Width = width; options.Height = height; // 设置二维码的边距,单位不是固定像素 options.Margin = 1 ; writer.Options = options; string fileName = _printImageDirectory + Guid.NewGuid().ToString(); Bitmap map = writer.Write(barCode); map.Save(fileName, ImageFormat.Png); map

Java 生成二维码实战

假如想象 提交于 2020-08-07 21:24:56
简介 ZXing 是一个开源 Java 类库用于解析多种格式的 1D/2D 条形码。目标是能够对QR编码、Data Matrix、UPC的1D条形码进行解码。其提供了多种平台下的客户端包括:J2ME、J2SE和Android。 官网:ZXing github仓库 实战 本例演示如何在一个非 android 的 Java 项目中使用 ZXing 来生成、解析二维码图片。 安装 maven项目只需引入依赖: <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.3.0</version> </dependency> 如果非maven项目,就去官网下载发布版本:下载地址 生成二维码图片 ZXing 生成二维码图片有以下步骤: 1、com.google.zxing.MultiFormatWriter 根据内容以及图像编码参数生成图像2D矩阵。 2、com.google.zxing.client.j2se

Android | 带你零代码实现安卓扫码功能

偶尔善良 提交于 2020-08-07 19:22:15
小序   这是一篇纯新手教学,本人之前没有任何安卓开发经验(尴尬),本文也不涉及任何代码就可以使用一个扫码demo,华为scankit真是新手的福音…… 背景介绍   最近被导师要求做一个购物收费的app,毕设好难呀~ 网上找了半天全是zxing,但是扫码效果真是有点小垃圾,无奈只能继续寻寻觅觅……突然发现网上有篇讲集成hms的文章,稍微借鉴了一下。由于在下是安卓小白,全篇没有一点代码,只是搬运一下华为网站的codelab,抱着忐忑的心情,竟然可以一键运行…… 前期准备   开发工具用的是android studio   用过android studio的人直接忽略,没用过的可以参考: https://developer.android.com/studio 相关的安装流程可以参考: https://www.cnblogs.com/xiadewang/p/7820377.html 。   zxing和华为扫码服务对比   回到我们的主题上—扫码,我在选择扫码库的时候,首先接触到的是google的开源库ZXing,也上手进行了实操,可以说集成过程还是蛮简单的,但是针对我本身的业务场景和需求,识别率上还是不够达标,自动对焦能力也不具备,不能够达到即开即用的要求,所以我就继续进行了调研,就了解到了华为的一个扫码服务,按照网站上的一些指引,20分钟就搞出来一个小demo,然后就真香

C#利用QrCode.Net生成二维码

核能气质少年 提交于 2020-08-07 07:21:20
现在网上很多应用都是用二维码来分享网址或者其它的信息。尤其在移动领域,二维码更是有很大的应用场景。因为项目的需要,需要在网站中增加一个生成二维码分析网址的功能,在谷歌大幅度抽筋的情况下无奈使用百度。百度N多,找到一些项目,但是可用性不强。(有一个项目是用VS2005开发的,在2010中调试不开。)终于在codeplex上找到一个“神器”,这个“神器”可以很方便的生成二维码,速度那是相当的快,并且可支持中文,遵从MIT协议。 QrCode.Net是一个使用C#编写的用于生成二维码图片的类库,使用它可以非常方便的为WinForm、WebForm、WPF、 Silverlight和Windows Phone 7应用程序提供二维码编码输出功能。可以将二维码文件导出为eps格式。 项目地址为: http://qrcodenet.codeplex.com QrCode.Net不再采用 http://code.google.com/p/zxing/ ZXing的端口,新的版本将有更好的性能。 测试结果如下(微秒): 输入字符串长度:74个 EC performance 1000 Tests~ QrCode.Net: 3929 ZXing: 5221 同时,QrCode.Net可以对字符串进行分析,决定是否使用UTF-8编码。(比如使用中文的时候。) QrCode使用方法:

C# zxing插件 根据输入的字符串生成二维码

爱⌒轻易说出口 提交于 2020-08-04 18:11:24
public ActionResult Erweis( string text) { BarcodeWriter writer = new BarcodeWriter(); writer.Format = BarcodeFormat.QR_CODE; QrCodeEncodingOptions options = new QrCodeEncodingOptions(); options.DisableECI = true ; // 设置内容编码 options.CharacterSet = " UTF-8 " ; // 设置二维码的宽度和高度 options.Width = 500 ; options.Height = 500 ; // 设置二维码的边距,单位不是固定像素 options.Margin = 1 ; writer.Options = options; Bitmap map = writer.Write(text); string di = text + DateTime.Now.ToString( " yyyyMMddHHmmss " ) + " .png " ; string path = Path.Combine(Request.MapPath( " /Content/ " ),di); // string filename = @"H:\桌面\截图

Xamarin Forms - Zxing QR Scanner - How can you toggle the camera being used?

前提是你 提交于 2020-06-13 06:37:39
问题 When I start scanning for barcodes using a ScannerView in Xamarian forms, it automatically goes to the back camera on the phone. I would like to make a toggle camera button that toggles the camera from back to front and vice versa. Is this possible using zxing for xamarin forms? My options look like this: code: //Set the scanner options. ScannerView.Options = new ZXing.Mobile.MobileBarcodeScanningOptions() { UseNativeScanning = true, AutoRotate = true, PossibleFormats = new List<ZXing

Xamarin Forms - Zxing QR Scanner - How can you toggle the camera being used?

∥☆過路亽.° 提交于 2020-06-13 06:37:06
问题 When I start scanning for barcodes using a ScannerView in Xamarian forms, it automatically goes to the back camera on the phone. I would like to make a toggle camera button that toggles the camera from back to front and vice versa. Is this possible using zxing for xamarin forms? My options look like this: code: //Set the scanner options. ScannerView.Options = new ZXing.Mobile.MobileBarcodeScanningOptions() { UseNativeScanning = true, AutoRotate = true, PossibleFormats = new List<ZXing

Qt编写项目作品26-一维码二维码解析及生成

£可爱£侵袭症+ 提交于 2020-05-07 12:50:22
一、功能特点 支持本地USB摄像头实时解析。 支持网络视频流实时解析。 解码格式支持一维码二维码等各种编码。 可生成一维码二维码,一维码支持EAN_13格式,其他格式可定制。 条形码参数支持宽度、高度、XY轴偏移值等。 可手动导入图片进行解析。 本地USB摄像头支持分辨率设置。 二、效果图 三、体验地址 体验地址: https://pan.baidu.com/s/1bbL2ZughZAgfIGrexyN-9g 提取码:zkeh 文件名:bin_video_zxing.zip 国内站点: https://gitee.com/feiyangqingyun 国际站点: https://github.com/feiyangqingyun 个人主页: https://blog.csdn.net/feiyangqingyun 知乎主页: https://www.zhihu.com/people/feiyangqingyun/ 备注:如果网盘下载不到可以去开源主页下载 来源: oschina 链接: https://my.oschina.net/feiyangqingyun/blog/4268936