Solved

Screen size on media component

Posted on 1997-10-17
3
163 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

5 Experts available now in Live!

Get 1:1 Help Now