.net bitmap file type limitations
Given the line:
Bitmap bitmap = new Bitmap(stream);
where stream is a System.IO.Stream, are there any limitations on the image file type e.g png, jpg, gif etc that can be handled. i.e are all image file/stream header info clear enough to say "I am an image".
I haven't run into any yet, but have only being using t开发者_如何学编程he pretty standard ones so far.
Thanks
I'm almost certain it's the same set as supported by the Bitmap(string) constructor: BMP, GIF, EXIF, JPG, PNG and TIFF.
Reference
Here is an overview of what is supported: http://msdn.microsoft.com/en-us/library/at62haz6.aspx
All the file types mentioned there are GDI+ which are supported by the .NET framework
It should work for all image formats for which the OS has a codec available.
Most 3rd party proprietary file formats fail such as PSD
. EPS
also fails.
These formats work:
BMP, GIF, EXIF, JPG, PNG and TIFF.
精彩评论