How do you use System.Drawing for reading .jpeg or .gif headers?

G

Guest

I need to read the header information on an image (could be a .jpeg, .gif,
..bmp) and find the height and width. I know I can open it as a binary file,
and bump to the appropriate location where height and width is stored in the
header, but I was wondering if anyone knows of a slick way of using
System.Drawing utilities to do this?
Thanks for any help you can give me.
 
M

Morten Wennevik

Brian,

If you load it as a Bitmap (Image.FromFile) you can read the Bitmap dimensions afterwards. Otherwise you will have to read the headers by hand and decode the files yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top