Hi, you can load an image in memory, make a thumbnail of the required size, and dispose of the original image in memory:
public Bitmap GetThumb(string path, int wid, int hei) {
Image img=Image.FromFile(path); // locks file and loads entire image
Bitmap bm=new Bitmap(img, wid, hei);
img.Dispose(); // gets rid of big image in memory, and also the file lock
return bm;
}
Remark: if wid and/or hei are much larger than 120 and the file does contain a thumbnail, then the above provides better quality than a simple Image.GetThumbnailImage(). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google