-- 作者:lxl
-- 发布时间:2010/7/1 22:36:00
--
看代码,这是一个托管dll,引用起来很简单了。
把QRCodeLib.dll放到foxtable目录下面就能直接用了。
Dim qrCodeEncoder As new QRCodeEncoder
Dim encoding As String= "Byte"
qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE Din scale As Integer = Convert.ToInt16(3) qrCodeEncoder.QRCodeScale = scale
Dim version As Integer = Convert.ToInt16(7) qrCodeEncoder.QRCodeVersion = version
Dim errorCorrect As String = cboCorrectionLevel.Text if errorCorrect = "L" Then qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.L elseif errorCorrect = "M" Then qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M elseif errorCorrect = "Q" Then qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.Q elseif (errorCorrect = "H" Then qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.H
End If
Dim image As Image Dim data As String = Tables("表A").Current("第一列")
image = qrCodeEncoder.Encode(data)
image.Save("d:\\图像\\a.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
大概是这样的 。没调试,可能有些错误
|