P
Peter Proost
Hi I got this code to read in a file to the database, if use it to save a
image from a picturebox to the database it works ok, but now I use it to
directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0) to coordinates(image.width,0) when I look at the blob field
using crystal reports 9, the line normaly isn't there.What am I doing wrong?
Dim ms As System.IO.MemoryStream
Dim arrImg As Byte()
Dim img As Bitmap
If File.Exists(myPath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing
img = DirectCast(Image.FromFile(myPath), Bitmap)
img.Save(ms, img.RawFormat.Bmp)
arrImg = ms.GetBuffer()
ms.Close()
End If
thanks in advance
Peter Proost
image from a picturebox to the database it works ok, but now I use it to
directly save a file to the database without loading the image in a
picturebox and it also works but there's a black line drawn from
coordinates(0,0) to coordinates(image.width,0) when I look at the blob field
using crystal reports 9, the line normaly isn't there.What am I doing wrong?
Dim ms As System.IO.MemoryStream
Dim arrImg As Byte()
Dim img As Bitmap
If File.Exists(myPath) Then
ms = New MemoryStream
'the next two lines are just to make sure everything is empty
ms.Flush()
arrImg = Nothing
img = DirectCast(Image.FromFile(myPath), Bitmap)
img.Save(ms, img.RawFormat.Bmp)
arrImg = ms.GetBuffer()
ms.Close()
End If
thanks in advance
Peter Proost