Dim t As Table = Tables(e.Form.Name & "_FSCard")
If t.Rows.Count > 0 Then
For Each r As Row In t.Rows
If r("qrcode") > "" Then
Else
If r("img") > "" Then
Dim bs As Byte() = Convert.FromBase64String(r("img"))
Dim stream As System.IO.Stream = New System.IO.MemoryStream(bs)
Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream)
Dim fl As String = ProjectPath & "fscard.jpg"
bmp.save(fl)
Application.DoEvents()
If FileSys.FileExists(fl) Then
Dim img As Image = Image.FromFile(fl) '图片地址哦!
Dim bmap As Bitmap
bmap = New Bitmap(img)
Dim source As New RGBLuminanceSource(bmap, bmap.Width, bmap.Height)
Dim bitmap As com.google.zxing.BinaryBitmap = New com.google.zxing.BinaryBitmap(New com.google.zxing.common.GlobalHistogramBinarizer(source))
Dim asd As new com.google.zxing.MultiFormatReader
Dim result As com.google.zxing.Result = asd.decode(bitmap)
r("qrcode") = result.Text
End If
End If
End If
Application.DoEvents()
Next
Else
MessageBox.Show("当前表无记录!")
End If