Dave Archer
Dave Archer

Reputation: 3060

.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 the pretty standard ones so far.

Thanks

Upvotes: 0

Views: 1055

Answers (4)

Jeremy Thompson
Jeremy Thompson

Reputation: 65692

Most 3rd party proprietary file formats fail such as PSD. EPS also fails.

These formats work:

BMP, GIF, EXIF, JPG, PNG and TIFF.

Upvotes: 0

Foole
Foole

Reputation: 4850

I'm almost certain it's the same set as supported by the Bitmap(string) constructor: BMP, GIF, EXIF, JPG, PNG and TIFF.

Reference

Upvotes: 3

Jasper
Jasper

Reputation: 451

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

Upvotes: 1

Thomas Levesque
Thomas Levesque

Reputation: 292615

It should work for all image formats for which the OS has a codec available.

Upvotes: 0

Related Questions