2

Given a Stream that I know will be a picture, is there a way to programmatically 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

Todd Main
  • 28,951
  • 11
  • 82
  • 146

2 Answers2

2

Image.RawFormat

Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
0

I think, by reading the first few bytes one sould be able to identify. LIke II* are the byes in tiff file. ‰PNGin png, BM in bmp files

Subhash Lama
  • 433
  • 2
  • 12