Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

TMediaPlayer position AVI centered within a TPanel?

Posted on 1998-10-21
5
775 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 60 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

808 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