Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TMediaPlayer position AVI centered within a TPanel?

Posted on 1998-10-21
5
Medium Priority
?
797 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:Kapusta
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 240 total points
ID: 1343832
Use the DisplayRect property of the TMediaPlayer.
0
 

Author Comment

by:Kapusta
ID: 1343833
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
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343834
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
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343835
oops

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

Cheers,

Raymond.
0
 

Author Comment

by:Kapusta
ID: 1343836
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question