Solved

TMediaPlayer position AVI centered within a TPanel?

Posted on 1998-10-21
5
771 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
Comment Utility
Use the DisplayRect property of the TMediaPlayer.
0
 

Author Comment

by:Kapusta
Comment Utility
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
Comment Utility
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
Comment Utility
oops

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

Cheers,

Raymond.
0
 

Author Comment

by:Kapusta
Comment Utility
Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I open IE in olecontainer? 7 108
how to center only a line in richedit? 4 44
Delphi selector screen 2 57
select query - oracle 16 81
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now