PDA

Click to See Complete Forum and Search --> : How to spare memory when loading a big picture into a smaller image control


jimmymou
Oct 7th, 2001, 02:05 PM
Hello,

I want to load big .jpg pictures from files into a 200x150pixel imagebox control (with the loadpicture command), and the stretch property of the imagebox is set to true (so the pictures are resized to fit the imagebox). In fact I need to create a sort of thumbnails browser for my project.

But I would like to avoid the use of too much memory when loading, let's say a 1600x1200 pixels 24bits bitmap in this 200x150pixel imagebox.

The loadpicture works well but the program keeps the full size of the original picture in memory (in this example this is +/- 5 Mb!), rather than only the only 90 kb needed for storing the real 200x150pixel 24bit image. It is all about sparing the max memory !

So my question is : how can I downsize a picture when loading it into an imagebox ? I want also to keep the possibility to use this picture for other operations(so a paintpicture procedure is not acceptable).

Thanks a lot for your guidelines !