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

2 Answers 2

2

Image.RawFormat

1
  • Brilliant, don't know how I missed that!
    – Todd Main
    Apr 20, 2011 at 18:52
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.