How to convert an Image to a string

M

mevar81

Hello to everybody.I have a problem.I used a
TypeDescriptor to retrieve a TypeConverter to convert an
Image to a string.The problem is that it converts the
image to the string "System.Drawing.Bitmap" so lately I
can't convert the string to an Image.I've tryed to use an
ImageConverter too,but the result is the same. Why the
converter works like the Image.ToString() method?What's
its goal?Anyone know how to convert an Image to a string
so after I can reconvert the string back to the Image?Or
anyone know how to retrieve the name of the file that
rappresents the image?Thaks to everybody.
 
H

Herfried K. Wagner [MVP]

* "mevar81 said:
TypeDescriptor to retrieve a TypeConverter to convert an
Image to a string.The problem is that it converts the
image to the string "System.Drawing.Bitmap" so lately I
can't convert the string to an Image.I've tryed to use an
ImageConverter too,but the result is the same. Why the
converter works like the Image.ToString() method?What's
its goal?Anyone know how to convert an Image to a string
so after I can reconvert the string back to the Image?Or
anyone know how to retrieve the name of the file that
rappresents the image?Thaks to everybody.

You may want to save the image to a 'MemoryStream' by using its 'Save'
method and use 'Image.FromStream' to get the image back.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 

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