extra line drawn to blob

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
 
P

Peter Proost

Just to say it seems that it has got nothing to do with my save method,
because if I load the image from the database it displays ok, it's just not
showing ok in crystal reports 9

Greetz Peter
 
P

Peter Proost

Hi just to let know I found then problem:

if change that with this:

img.Save(ms, img.RawFormat.Jpeg)

the extra line isn't drawn in crystal reports

Greetz Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top