Read image dimensions w/o loading to memory

E

emars

Greetings,
I am working with very large bitmaps in the 11,000x17,000 range and I
need to read the image dimensions (in pixels) in my app. Windows XP
can list dimensions as easily as time/date or file size as one of the
details in the file explorer, how can I do this with my simple C# app?

I have tried loading it as a nonvisible picturebox:
picturebox.Visible=false;
I have tried loading it into a bitmap and reading dimensions from
there:
img = (Bitmap)Image.FromFile(openImg);
width = img.Width;
height = img.Height;

These are very memory costly, and I want a BETTER way!

opensource libraries such as imagemagick have this functionallity but
I have not been able to catch their output yet, has anybody tried this
library to success?

Thanks all
 

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