Solved

Screen size on media component

Posted on 1997-10-17
3
181 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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