Solved

Picturebox: load image from string data?

Posted on 2006-06-18
1
356 Views
Last Modified: 2008-03-04
Hello

I am saving jpeg-files in an xml-file. Then I read the data of the jpeg-file into a string, how can I now load it into a picturebox without saving it to a jpeg-file and loa it from there?

Thanks

sven
0
Comment
Question by:Ruttensoft
[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
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 16934724
Here is a class for memory image conversions:

Imports System.IO
Imports System.Drawing.Imaging

Public Class MemoryImage

  Public Shared Function ByteArrayToImage(ByVal buffer() As Byte, ByVal fileName As String) As Image

    Dim ms As New MemoryStream(buffer)
    Dim img As Image = Image.FromStream(ms)
    Return img

  End Function

  Public Shared Function ImageToByteArray(ByVal img As Image, ByVal format As ImageFormat) As Byte()

    Dim ms As New MemoryStream
    img.Save(ms, format)

    Return ms.ToArray()

  End Function

End Class

Bob
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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