Solved

Screen size on media component

Posted on 1997-10-17
3
176 Views
Last Modified: 2010-05-18
Is there a way to change the screen size when using the Tmedia component (I use D3)?  For example, when I click the "play" button, and an avi file plays, it always defaults to
a "default" size.  I would like to center it and adjust the size larger or smaller. Is there a way with this component?
                  Thanks
0
Comment
Question by:jexd99
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1347865
Hi jexd99,
still working on your screensaver?
Use the DisplayRect property to change the size of the AVI file output window. You can use DisplayRect to cause your AVI file's output to stretch or shrink to a certain size. e.g. You want that the AVI file take's up the whole area of Panel1 :
Mediaplayer1.DisplayRect := Rect(0,0,Panel1.Width, Panel1.Height);

So when the user presses a button :

procedure Form1.Button1Click(Sender:TObject);
begin
 if OpenDialog1.Execute then begin
   MediaPlayer1.FileName := OpenDialog1.FileName;
   MediaPlayer1.Open;
   MediaPlayer1.DisplayRect := Rect(0, 0, Panel1.Width, Panel1.Height);
 end;
end;

Have fun watchin the movie!
c.u. ZifNab;

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1347866
Hi jexd99,
forgot to tell you something:
Change the MediaPlayer1.Display property to panel1. (Put a Panel1 and MediaPlayer1 on a form). You can choose panel1 for display after you've put the panel1 on the form.
Have fun!
c.U. ZifNab;
0
 

Author Comment

by:jexd99
ID: 1347867
Thanks Zif!
I actually got the previous screensaver done and working, but
it took me alot longer than I planned! :)  I am trying to experiment with the media player because I haven't messed around with it much yet. I was looking at the display property with a panel trying to get it to work, but the key is the "displayrect".
I was soooooooo close! :)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show Listview image from database (String field) 5 127
Reconfigure Delphi Install? 2 51
Delphi Yen format 3 35
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 34
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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