| Robert 2006-10-25, 6:02 am |
| I have a SQL CE 2.0 DB that has a colomn defined as image filled tif
signature images. I want to display that tif signature in a picture box in
VB.NET. The code that fialed to work is as follow:
Dim imgArray() As Byte = CType(myReader.GetValue(0), Byte())
Dim sw As StreamWriter = File.CreateText("TmpSig.tif")
sw.Write(imgArray)
sw.Close()
myPictureBox.Image = New System.Drawing.Bitmap("TmpSig.tif")
The exception was thrown at the last line with error message as follow (in
Command Window):
?ex.message
"ArgumentException"
When I check the value of the imgArray in Command Window it shows
?imgArray
{Length=&H58C}
(&H0): &H49
(&H1): &H49
(&H2): &H2A
(&H3): &H0
(&H4): &HA2
(&H5): &H4
(&H6): &H0
(&H7): &H0
(&H8): &H4C
(&H9): &H69
(&Ha): &H67
(&Hb): &H68
(&Hc): &H74
(&Hd): &H2D
(&He): &H4C
(&Hf): &H69
(&H10): &H62
.......
It seems the signature data has been read into the byte array. it was unable
to display the tif image. I know I am not on the right track but have no
idea how this should be done.
Any ideas?
Thanks a lot!
-Robert
|