自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

二維碼的生成與掃描 源碼下載

移動開發(fā)
搜集了二維碼的生成、掃描功能代碼,掃描功能 包括了 二維碼、條碼的掃描,具有 360掃描的UI效果,作為二維碼的工具。

搜集了二維碼的生成、掃描功能代碼,掃描功能 包括了 二維碼、條碼的掃描,具有 360掃描的UI效果,作為二維碼的工具。

源碼簡介

源碼運行截圖

 

運行截圖

二維碼、條碼的掃描

二維碼的生成  

源碼片段

  1. /*** 
  2.      * 
  3.      * @param string  生成二維碼的字符串 
  4.      * @param format  二維碼的格式 
  5.      * @return     返回二維碼圖片 
  6.      * @throws WriterException 
  7.      */ 
  8.     public Bitmap qr_code(String string, BarcodeFormat format) 
  9.             throws WriterException { 
  10.         MultiFormatWriter writer = new MultiFormatWriter(); 
  11.         Hashtable<encodehinttype, string=""> hst = new Hashtable<encodehinttype, string="">(); 
  12.         hst.put(EncodeHintType.CHARACTER_SET, "UTF-8"); 
  13.         BitMatrix matrix = writer.encode(string, format, 400400, hst); 
  14.         int width = matrix.getWidth(); 
  15.         int height = matrix.getHeight(); 
  16.         int[] pixels = new int[width * height]; 
  17.         for (int y = 0; y < height; y++) { 
  18.             for (int x = 0; x < width; x++) { 
  19.                 if (matrix.get(x, y)) { 
  20.                     pixels[y * width + x] = 0xff000000
  21.                 } 
  22.   
  23.             } 
  24.         } 
  25.         Bitmap bitmap = Bitmap.createBitmap(width, height, 
  26.                 Bitmap.Config.ARGB_8888); 
  27.         // 通過像素數(shù)組生成bitmap,具體參考api 
  28.         bitmap.setPixels(pixels, 0, width, 00, width, height); 
  29.         return bitmap; 
  30.     } 
  31. </encodehinttype,></encodehinttype,> 

源碼下載地址:http://down.51cto.com/data/1968746

責任編輯:閆佳明 來源: 網(wǎng)絡整理
相關(guān)推薦

2024-06-26 08:46:45

2015-10-28 13:33:50

二維碼條形碼掃描源碼

2023-11-17 15:44:06

C++庫生成二維碼

2023-11-17 09:07:51

.NET生成二維碼識別二維碼

2015-09-24 09:56:19

.NET二維碼

2013-10-29 09:46:05

二維碼

2013-03-27 16:13:17

Android開發(fā)Android二維碼生QR生成

2013-01-30 12:16:49

二維碼NFC近場通訊

2023-10-31 08:16:16

Go語言二維碼

2015-07-22 10:46:20

二維碼掃描

2020-04-01 10:06:41

二維碼技術(shù)服務端

2024-11-20 13:00:02

2020-08-07 14:18:03

二維碼Go語言編程

2017-11-21 09:00:15

PHP二維碼LOGO圖像

2021-02-08 08:40:00

Zint二維碼開源

2017-02-21 09:17:46

二維碼漏洞

2012-04-01 09:53:13

二維碼

2011-12-06 16:40:45

二維碼快拍二維碼靈動快拍

2011-11-24 16:00:23

信息圖QR碼二維碼

2022-03-24 09:43:29

二維碼二維碼修改器github
點贊
收藏

51CTO技術(shù)棧公眾號