当前位置:首页 > 通信资讯 > 正文

我就给大家介绍下这个程序库,你可以在这里下载。

简介

程序库提供了名为scan的方法来读取二维码图像。这是一个重载方法,在这部分,我列出了它的定义方法。这些方法将在代码中测试这个程序库的表现。

publicstaticstring [] scan (bitmap bitmap);

在所有支持的二维码种类中扫描某个的图像:

  • bitmap: 要扫描的图像

publicstaticstring[] scan(bitmap image, barcodetype barcodetype);

在特定的二维码中扫描某个图像:

  • bitmap: 要扫描的图像
  • barcodetype: 指定的二维码种类

publicstaticstring[] scan(bitmap bitmap, rectangle rect, barcodetype barcodetype);

在特定的二维码中扫描某个图像的指定一部分:

  • bitmap: 要扫描的图像
  • rect: 指定要扫描的位图的部分
  • barcodetype: 指定的二维码种类

简单代码

为了验证scan方法,我做了幅二维码图像命名为barcode.jpg.在这幅图中有很多元素:有三个qr code二维码,两个codabar 二维码和一个postnet 二维码。用不同的参数来扫描这些图形,我们应该会得到不同的结果。

使用spire.barcode程序库生成二维码的实(使用spire.barcode程序库生成二维码的实)

下面是结果:

程序片段:

?
1 datas = barcodescanner.scan(bitmap);

结果:

使用spire.barcode程序库生成二维码的实(使用spire.barcode程序库生成二维码的实)

程序片段:

?
1 datas = barcodescanner.scan(bitmap, barcodetype.codabar);

结果:

使用spire.barcode程序库生成二维码的实(使用spire.barcode程序库生成二维码的实)

程序片段:

?
1 datas = barcodescanner.scan(bitmap, newrectangle(0, 0, bitmap.width, bitmap.height / 2),barcodetype.qrcode);

结果:

使用spire.barcode程序库生成二维码的实(使用spire.barcode程序库生成二维码的实)

结论:

你可以自己试试看,我觉得这个程序库一定可以满足你。

原文链接:http://blog.csdn.net/eiceblue/article/details/43405173

如果您对该产品感兴趣,请填写办理(客服微信:xiaoxiongyidong)

为您推荐:

发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。