Discussion:
Playing video and fit to window
(too old to reply)
Brian
2005-10-16 01:29:49 UTC
Permalink
Hi

I have been playing about with video, I have added a TMediaPlayer to a form,
added a panel, and assigned the display to the panel.
What I am trying to do is keep the aspect ratio or the video, but expand the
video to fit the form.
The video will play but will not fill the panel, how can I get it to do
this? I
can't find anything on the net about using video in Delphi or and options
to expand it.

Thanks in advance

Brian
Jamie
2005-10-16 22:13:00 UTC
Permalink
Post by Brian
Hi
I have been playing about with video, I have added a TMediaPlayer to a form,
added a panel, and assigned the display to the panel.
What I am trying to do is keep the aspect ratio or the video, but expand the
video to fit the form.
The video will play but will not fill the panel, how can I get it to do
this? I
can't find anything on the net about using video in Delphi or and options
to expand it.
Thanks in advance
Brian
your going yo have a hard time dealing with that.
first of all, you should be using more direct
code to send the image to an inmemory bitmap then
you could perform a stretch effect for display how ever,
this can and will take up CPU time.
you would be better off in enumerating the output
resolution options of the device and set it to one
that is closes to fit your app and simply adjust the
window on your app.
--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Heinrich Wolf
2005-10-18 05:39:42 UTC
Permalink
Hi,

you already stretch your video by setting it
to fit the panel and by setting the size of the panel.
Very good.

Now you have some border? black? Top and bottom?
That may be part of the video. A movie
displayed in a tv window?
You need to re-render the video
to eliminate such a border.
MediaPlayer cannot do that job.

You do not know how to keep the aspect ratio?
Immediately after opening the video,
before setting it to fit into the panel,
you should examine the height and width of the video.
Then you can grow the panel proportional.

Unfortunately there are some types of video,
which are not understood by media player,
like SVCD. That has no square,
but vertically stretched pixels.
I do not know, how to determine that case
with MediaPlayer.

Regards
Heiner
Brian
2005-10-19 18:53:39 UTC
Permalink
Post by Heinrich Wolf
you already stretch your video by setting it
to fit the panel and by setting the size of the panel.
Very good.
Now you have some border? black? Top and bottom?
That may be part of the video. A movie
displayed in a tv window?
You need to re-render the video
to eliminate such a border.
MediaPlayer cannot do that job.
You do not know how to keep the aspect ratio?
Immediately after opening the video,
before setting it to fit into the panel,
you should examine the height and width of the video.
Then you can grow the panel proportional.
Unfortunately there are some types of video,
which are not understood by media player,
like SVCD. That has no square,
but vertically stretched pixels.
I do not know, how to determine that case
with MediaPlayer.
Regards
Heiner
Hi guys

I have been looking about and have come across
a component that will do just the job :)

Thanks for your replies

Brian

Loading...