AVI video and Delphi (How can I get width and heigth of an AVI?)

5 views
Skip to first unread message

Jungle

unread,
Jan 15, 1997, 3:00:00 AM1/15/97
to

I need to know how to get the width and heigth of an AVI video in
Delphi. The only basic knowledge I have about that is MCI.

It would be great if you can show me an exemple with you
explainations.

I need to know which code should I use and which library (if there's
one).

Thank you,

Patrick
psta...@mixmedia.qc.ca

fred011

unread,
Jan 21, 1997, 3:00:00 AM1/21/97
to

This is rather easy and comes from Lloyd's Help File,

To make a AVI fit in a panel use this code:

begin
with MediaPlayer1 do begin
DeviceType := dtAutoSelect;
visible := false;
FileName := InputBox('AVI', 'Enter AVI file name',
'c:\windows\borland.avi');
display := panel1;
open;
DisplayRect := rect(0, 0, panel1.width, panel1.height); {This is it!}
rewind;
play;
end;
end;

{ This code came from Lloyd's help file! }

Now to doe the reverse and make the panel the same size as the default avi
size, load the avi file first, then size the panle based on the Trect
parameters, like so:

A: Note: the DisplayRect property is modified when the avi file is
opened. Therefore, setting or getting the DisplayRect must be done after
the file is opened.

var
t: trect;
begin
with MediaPlayer1 do begin
DeviceType := dtAutoSelect;
visible := false;
FileName := InputBox('AVI', 'Enter AVI file name',
'c:\windows\borland.avi');
display := panel1;
open;
t := DisplayRect;
caption := IntToStr(t.left) + ' : ' + IntToStr(t.top) + ' : ' +
IntToStr(t.right) + ' : ' + IntToStr(t.bottom); {This is it!}
rewind;
play;
end;
end;

{ This code came from Lloyd's help file! }

good luck
fred011
Jungle <psta...@mixmedia.qc.ca> wrote in article
<5bj57n$flp$1...@wagner.spc.videotron.ca>...

Reply all
Reply to author
Forward
0 new messages