Create image thumbnail without opening complete image

G

Guest

Hi all,
I have a directory full of images (most over 2MB in size) I was to show
each image as a thumbnail on a form, however in order to create a thumbnail I
have to open the complete image then scale it down. This is quite slow,
since there is a lot of file IO going on, what I want to be able to do is
open the image in the scaled down size so that I miss out the step of opening
the file then dowsizing it. I have not been able to find any way to do this
using .NET, possibly it is some Win32 API call, does anyone know?

If you look in Windows Explorer in thumbnail view it shows a thumbnail for
all the images in a directory lightening fast, there must be some Win32
method that can produce thumb size images without reading the whole file -
how can I be this fast using .Net?

Thanks
Mark
 
A

Atul

Using IExtractImage will provide a speed advantage only if thumbnails are
already generated and cached.

If not, then it is not possible to generate a thumbnail without having to
read the whole image file.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
&
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
----------------



Nicholas Paldino said:
Mark,

In order to do this, you will want to use the IExtractImage interface
on the shell item (through COM interop). Here is a link to an old post on
google where I link to how to do this (watch for line wrap):

http://groups.google.com/group/micr...+author:Paldino&rnum=5&hl=en#aac571f730e13a25

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Mark R. Dawson said:
Hi all,
I have a directory full of images (most over 2MB in size) I was to
show
each image as a thumbnail on a form, however in order to create a
thumbnail I
have to open the complete image then scale it down. This is quite slow,
since there is a lot of file IO going on, what I want to be able to do is
open the image in the scaled down size so that I miss out the step of
opening
the file then dowsizing it. I have not been able to find any way to do
this
using .NET, possibly it is some Win32 API call, does anyone know?

If you look in Windows Explorer in thumbnail view it shows a thumbnail
for
all the images in a directory lightening fast, there must be some Win32
method that can produce thumb size images without reading the whole
file -
how can I be this fast using .Net?

Thanks
Mark
 

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