Link to home
Start Free TrialLog in
Avatar of Mr_Fulano
Mr_FulanoFlag for United States of America

asked on

Thumbnail Viewer

Hi, I'm using VB2010, Winforms. I'm trying to create a Thumbnail Viewer so that I can read the thumbnail from a folder's Thumb.DB file. Has anyone every tried to do that?

If not, is there a way to create an object that will accept a raw image file and produces the image? For example, I'd like to pass to that object the code that makes up an image and have the object (maybe a picture viewer object of some kind) reproduce that image. -- I want to be clear on that I want to pass the "code" that makes up an image and not place an image into a picture box object - that I know how to do. I want to use the actual characters that the image is made of.

Any ideas how this can be done?

Thanks,
Fulano
Avatar of kaufmed
kaufmed
Flag of United States of America image

I want to use the actual characters that the image is made of.

I *think* you mean the "bytes" that the image is made of, not the "characters." I could be wrong. Assuming I'm not, you can load the bytes into a MemoryStream and then pass that stream to one of the Image class' static methods; namely FromStream().

e.g.
using System.IO;

...

byte[] imgData = <some bytes>;
MemoryStream ms = new MemoryStream(imgData);

using (Image img = Image.FromStream(ms))
{
    // Do something with img
}

Open in new window

Avatar of Mr_Fulano

ASKER

Hi Kaufmed, yes you are correct. I mean the bytes that make up the image. - Let me play around with this for a while and I'll get back soon.

Thanks,
Fulano
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi CodeCruiser, hope all is well. - I looked at your suggested links and think this will get me started. I'll work on my project and if I need more help, I'll post another question. Thanks for the info!

Fulano
Good examples!
Glad to help :-)