memorystream bytes to bitmap

G

Guest

Hi, I have some code here
Dim g As Graphics
Dim g2 As Graphics
Dim bm As Bitmap
Dim bm2 As Bitmap
Dim bitmapbytestream() As Byte
Dim b2() As Byte
Dim ms As New MemoryStream()

bm.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
bitmapbytestream = ms.ToArray
bm2 = New Bitmap(71, 92)
Dim STRM As New MemoryStream(bitmapbytestream)
bm2 = Bitmap.FromStream(STRM)
pbo1.Image = bm2

I'm sure there is something silly missing but have tried numerous variations
and no matter what I do the image in the picture box pbo1 appears totally
black.
bm by the way is an image already succesfully stored.

Any help would be great.
 
G

Guest

Sorry, not deliberate, got an error when I posted this and presumed obviously
incorrectly that it hadn't been processed.
 
C

Cor Ligthert

Sorry, not deliberate, got an error when I posted this and presumed
obviously

No problem, however when I put double post in the subject than everybode can
see that, there is no need to excuse.

Cor
 

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