By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

extra line drawn to blob

P: n/a
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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I mean image not file
Hi I got this code to read in a file to the database, if use it to save a
Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:uG**************@TK2MSFTNGP15.phx.gbl... 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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

Nov 21 '05 #2

P: n/a
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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:ud**************@TK2MSFTNGP12.phx.gbl...
I mean image not file
Hi I got this code to read in a file to the database, if use it to save a

Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:uG**************@TK2MSFTNGP15.phx.gbl...
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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.


Nov 21 '05 #3

P: n/a
Hi just to let know I found then problem:
img.Save(ms, img.RawFormat.Bmp)
if change that with this:

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

the extra line isn't drawn in crystal reports

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:ef**************@TK2MSFTNGP10.phx.gbl...
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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:ud**************@TK2MSFTNGP12.phx.gbl...
I mean image not file
Hi I got this code to read in a file to the database, if use it to
save
a

Sorry

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:uG**************@TK2MSFTNGP15.phx.gbl...
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

--
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to

produce bigger and better idiots. So far, the Universe is winning.



Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.