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

creat image from stream.

P: n/a
I have a bimap picuture saved in an access file. the table column type is
OLE object. In VB.Net I am trying to load this image and show it on the
form. I use following code.

Dim pitbyte() As Byte

pitbyte = drCurrent("pic")

Debug.WriteLine(drCurrent("pic"))

Dim ms As MemoryStream = New MemoryStream(pitbyte)

Dim streamedBitmap As Bitmap

streamedBitmap = Bitmap.FromStream(ms) '******** this line cause problem

Me.methodpic.Image = streamedBitmap

then"An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll

Additional information: Invalid parameter used."

Could anybody tell me why I get Invalid parameter used exception?
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
David,

No guarantees, however you can try this one.
\\\
Dim ms As MemoryStream = New MemoryStream(pitbyte, 78, pitbyte.Length-78)
///
I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
I tried. It still doesnot work
have you encount same problem?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:#W**************@TK2MSFTNGP12.phx.gbl...
David,

No guarantees, however you can try this one.
\\\
Dim ms As MemoryStream = New MemoryStream(pitbyte, 78, pitbyte.Length-78)
///
I hope this helps?

Cor

Nov 21 '05 #3

P: n/a
David,

AFAIK It seems that there are 2 Ole formats and a normal format of a blob.
You used the normal and 1 of the OLe's now, I do not know the thirth

Cor
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.