Given a Stream
that I know will be a picture, is there a way to program开发者_JS百科matically determine if it is a Bitmap
or a MetaFile
when pulled from Image.FromStream(mystream)
? Like a flag or something.
Environment: .NET, System.Drawing, C#/VB
Image.RawFormat
I think, by reading the first few bytes one sould be able to identify. LIke II*
are the byes in tiff file. ‰PNG
in png, BM
in bmp files
精彩评论