473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Create image thumbnail without opening complete image

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

Nov 17 '05 #1
2 4557
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/micro...c571f730e13a25

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark R. Dawson" <Ma*********@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
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

Nov 17 '05 #2
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
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/micro...c571f730e13a25

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark R. Dawson" <Ma*********@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
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


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
PHP 4.3.2 with --enable-exif I have the following class: <?php class ThumbGenerator extends MethodGeneratorForActionPerformer { function ThumbGenerator() { // CONSTRUCTOR
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
0
by: Balu Ramachandran | last post by:
How can I create the Thumbnail view from the form? In the following approach I tried but Iams facing some limitations to get the thumbnail image of the form alone. Plaese any one can help in...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
3
by: christiang | last post by:
Hi guys, I'd like to use Alexia thumbnail service. It's an interesting service, you pass an url to its cgi and you get a thumbnail of that url. Of course they don't have the screenshots of all the...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
15
by: mistral | last post by:
I want find code for clickable thumbnails, when click on small picture, a big image will popup in new window, sized to fit picture. Same as standard javascript image previewer, but without using...
6
by: mistral | last post by:
Is there way change image (swap) on click on thumbnail without javascript? I.e. main image is big(preview), and below it is two small images - when click on small image, it should change big image....
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.