Solved

Converting from byte[] to an image

Posted on 2006-07-18
3
197 Views
Last Modified: 2010-04-23
I have images stored in a datatable as Byte []. I would like to retrieve these pictures and display them in a picture box.
0
Comment
Question by:lgropper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17131470
'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
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 500 total points
ID: 17131476
Whoops, forgot:

       Dim byteBLOBData() As Byte
0
 

Author Comment

by:lgropper
ID: 17132024
Works perfect. Thank you.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question