TMediaPlayer position AVI centered within a TPanel?

Using Delphi 1... I am wondering if it is possible to center a AVI multimedia file within a TPanel component?  For example, if I set the Display property of a TMediaPlayer component to a TPanel like the following :

MediaPlayer1.Display := Panel1;

...how can I position a loaded AVI file within the TPanel perfectly centered?  It would be nice if the TPanel would resize automatically based upon the height and width of the AVI, just like the TBitmap.Autosize := True.

Thanks.
KapustaAsked:
Who is Participating?
 
rwilson032697Connect With a Mentor Commented:
Use the DisplayRect property of the TMediaPlayer.
0
 
KapustaAuthor Commented:
How does DisplayRect allow me to CENTER JUSTIFY the AVI if I don't know the dimensions (H x W) of the AVI being loaded?
0
 
rwilson032697Commented:
Becase DisplayRect is set to the default size when the device is opened. So you can open it - see how big it is going to be and adjust the top and left properties of the rectangle to center it...
0
 
rwilson032697Commented:
oops

. and then play the AVI when you have adjusted DIsplayRect.

Cheers,

Raymond.
0
 
KapustaAuthor Commented:
Thanks!
0
All Courses

From novice to tech pro — start learning today.