How get files dimensions?

  • Thread starter Thread starter alexsts
  • Start date Start date
A

alexsts

Hello to all,
People I stumble on some problem and need resolution.
All of us see on explorer bar this nice thing called files attribute.
That thing let us know for example how long video file will play or how

big pictures are.
My problem is I need to get this info from my directory and put it into

normal excel file or at least display it in webpage.
I try to use FileSystemObject but it did not have muscle to do what I
need.
How this can be done?
Any help will be mucho appreciated.
 
Try having a look at the System.Drawing.Imaging and use an Image or Bitmap

Bitmap img = new Bitmap("filename.jpg");
x = img.Width;
y = img.Height;

Hope that helps. Jsut remember to do some tidying up or it leaves files
open everywhere.
 
alexsts said:
What about video files?
how long is video?

You will need to open the file, and read the appropriate video header. This
means, you'll need to find out information about the video file format, and
read the data in with a FileStream, or similar.
 
No it did not.
I open Stream and got loot of junk data which could not be interpreted
into web page or any type humanly readable data. Considering that I can
not read machine code yet....

But thanks anyway.
 
alexsts said:
No it did not.
I open Stream and got loot of junk data which could not be interpreted
into web page or any type humanly readable data. Considering that I can
not read machine code yet....

But thanks anyway.

Hi,

You can't just read a video file into a webpage. A video file is binary
data, and you have to analyse the binary data that you've read.

This webpage will help you analyse an AVI file:
http://www.jmcgowan.com/avitech.html#Format

But be warned, it's not simple.
 
Actually what I need is read header of the video file same way as I
could for MP3 to get info from there and display in web page.
That exactly what I try to do.
It did worked for MP3's but is there a way to do same for ASF / AVI?
 

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

Back
Top