文档详情

二维码识别源代码.docx

发布:2017-12-12约1.22万字共10页下载文档
文本预览下载声明
QRCode Decodeusing System;using System.Text;using QRCodeImage = ThoughtWorks.QRCode.Codec.Data.QRCodeImage;using QRCodeSymbol = ThoughtWorks.QRCode.Codec.Data.QRCodeSymbol;using ReedSolomon = ThoughtWorks.QRCode.Codec.Ecc.ReedSolomon;using DecodingFailedException = ThoughtWorks.QRCode.ExceptionHandler.DecodingFailedException;using InvalidDataBlockException = ThoughtWorks.QRCode.ExceptionHandler.InvalidDataBlockException;using SymbolNotFoundException = ThoughtWorks.QRCode.ExceptionHandler.SymbolNotFoundException;using Point = ThoughtWorks.QRCode.Geom.Point;using QRCodeDataBlockReader = ThoughtWorks.QRCode.Codec.Reader.QRCodeDataBlockReader;using QRCodeImageReader = ThoughtWorks.QRCode.Codec.Reader.QRCodeImageReader;using DebugCanvas = ThoughtWorks.QRCode.Codec.Util.DebugCanvas;using DebugCanvasAdapter = ThoughtWorks.QRCode.Codec.Util.DebugCanvasAdapter;using QRCodeUtility = ThoughtWorks.QRCode.Codec.Util.QRCodeUtility;namespace ThoughtWorks.QRCode.Codec{public class QRCodeDecoder{ internal QRCodeSymbol qrCodeSymbol; internal int numTryDecode; internal System.Collections.ArrayList results; internal System.Collections.ArrayList lastResults = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10)); internal static DebugCanvas canvas; internal QRCodeImageReader imageReader; internal int numLastCorrections; internal bool correctionSucceeded;public static DebugCanvas Canvas{get{return QRCodeDecoder.canvas;}set{QRCodeDecoder.canvas = value;}}virtual internal Point[] AdjustPoints{get{// note that adjusts affect dependently// i.e. below means (0,0), (2,3), (3,4), (1,2), (2,1), (1,1), (-1,-1)//Point[] adjusts = {new Point(0,0), new Point(2,3), new Point(1,1), //new Point(-2,-2), new Point(1,-1), new Point(-1,0), new Point(-2,-2)};System.Collections.ArrayList adjustPoints = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));for (int d = 0; d 4; d++)adjustPoints.Add(new Point(1, 1));int lastX = 0, lastY = 0;for (int y = 0; y
显示全部
相似文档