I'm using .net framework 4.0, System.Drawing.Image.FromFile to read in the bitmap and jpeg format images.
using (Image img = Image.FromFile("image file path")) { }
I put a stopwatch just to track the time taken, and it show me the result that take in bitmap is faster than jpeg images??
same image but different format and size. example result as below:
image1.bmp (~4938 KB) - time taken ~5 ms. (faster)
image1.jpg (~545 KB)- time taken ~54 ms. (slower)
My question is:
1. Is it possible that the method read in the bitmap (big size) can faster than jpeg (small size)? Why?
2. Could someone please help to explain the logic happen in "Image.FromFile()" method for different file format?
i search the msdn and web, but cannot find the performance details related to the file format.
http://msdn.microsoft.com/en-us/library/4sahykhd%28v=vs.100%29.aspx
thanks.