Solved

Converting from byte[] to an image

Posted on 2006-07-18
3
193 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now