• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Converting from byte[] to an image

I have images stored in a datatable as Byte []. I would like to retrieve these pictures and display them in a picture box.
0
lgropper
Asked:
lgropper
  • 2
1 Solution
 
ZeonFlashCommented:
'Get the byte data of the image
byteBLOBData = dsImage.Tables(0).Rows(0)("Image")

'Create a new memory stream with the byte array data
Dim stmBLOBData As New MemoryStream(byteBLOBData)

'Update the picturebox image with the stream data
picBLOB.Image = Image.FromStream(stmBLOBData)
0
 
ZeonFlashCommented:
Whoops, forgot:

       Dim byteBLOBData() As Byte
0
 
lgropperAuthor Commented:
Works perfect. Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now