Image.FromFile is very SLOW. Any alternatives, optimizations?
.net, c#, image, performance, winforms
Solution
If you are trying to make thumbnails then try this code here it will let you extract thumbnails without completely loading the image.
Problem
I have a winforms image list which contains say like 200 images 256x256. I use the method `Images.FromFile` to load the images and then add them to the image list. According to ANTS .NET profiler, half of the program's time is spent in `Images.FromFile`. Is there a better way to load an image to add to an image list? Another thing that might be optimized is, the images that are loaded are larger than 256x256. So is there a way to load them by resizing them first or something? I just want to uniform scale them if they their height is larger than 256 pixels. Any idea to optimize this? EDIT: They are JPEGs.