'方法一,不需寫成檔案即可讀成圖片
Dim V_byte() As Byte
V_byte = DS.Tables(0).Rows(0).Item("pic")
Dim intLength As Integer = UBound(V_byte)
Dim V_stream As New System.IO.MemoryStream(V_byte, 0, intLength)
PictureBox1.Image = Image.FromStream(V_stream)
'方法二,寫成圖片檔
My.Computer.FileSystem.WriteAllBytes(Trim(DS.Tables(0).Rows(0).Item("filename")), DS.Tables(0).Rows(0).Item("pic"), True)
V_image = Image.FromFile(Application.StartupPath & "\" & Trim(DS.Tables(0).Rows(0).Item("filename")), False)
PictureBox1.Image = V_image
沒有留言:
張貼留言