| Author |
Message |
Dave
Guest
|
Posted:
Fri Dec 23, 2005 5:30 pm Post subject:
stretch to fit and aspect ratio |
|
|
I have a question regarding the stretchtofit property. I am using VB .Net
and using the WMP object just fine. Is there any way to stretch playback to
the size of the control without maintaining the aspect ratio?
|
|
| Back to top |
|
 |
Neil Smith [MVP Digital M
Guest
|
Posted:
Fri Dec 23, 2005 9:30 pm Post subject:
Re: stretch to fit and aspect ratio |
|
|
On Fri, 23 Dec 2005 07:38:02 -0800, "Dave"
<Dave@discussions.microsoft.com> wrote:
| Quote: | I have a question regarding the stretchtofit property. I am using VB .Net
and using the WMP object just fine. Is there any way to stretch playback to
the size of the control without maintaining the aspect ratio?
|
It should fill the control while distorting the aspect ratio, if you
make your object width and heigh as desired and set stretchToFit
false.
Say you had a video at 192x168 pixels, and you set your player UI
width and height to 192x200 pixels, it should be distorted. Is this
different from your experience ?
Cheers - Neil |
|
| Back to top |
|
 |
Dave
Guest
|
Posted:
Fri Dec 23, 2005 9:30 pm Post subject:
Re: stretch to fit and aspect ratio |
|
|
The stretch to fit property is not fully stretching the video. It appreas to
be stretching it until the width fills the screen and I'm left with black
bars on the top and bottom (16:9 video on a 4:3 screen, centered). I am 100%
sure the content I'm playing does not have these black bars. With
stretchtofit set to false the video plays as I would expect (original aspect
ratio, no stretching).
"Neil Smith [MVP Digital Media]" wrote:
| Quote: | On Fri, 23 Dec 2005 07:38:02 -0800, "Dave"
Dave@discussions.microsoft.com> wrote:
I have a question regarding the stretchtofit property. I am using VB .Net
and using the WMP object just fine. Is there any way to stretch playback to
the size of the control without maintaining the aspect ratio?
It should fill the control while distorting the aspect ratio, if you
make your object width and heigh as desired and set stretchToFit
false.
Say you had a video at 192x168 pixels, and you set your player UI
width and height to 192x200 pixels, it should be distorted. Is this
different from your experience ?
Cheers - Neil
|
|
|
| Back to top |
|
 |
Neil Smith [MVP Digital M
Guest
|
Posted:
Fri Dec 23, 2005 9:30 pm Post subject:
Re: stretch to fit and aspect ratio |
|
|
On Fri, 23 Dec 2005 10:55:02 -0800, "Dave"
<Dave@discussions.microsoft.com> wrote:
| Quote: | The stretch to fit property is not fully stretching the video. It appreas to
be stretching it until the width fills the screen and I'm left with black
bars on the top and bottom (16:9 video on a 4:3 screen, centered).
|
Thats exactly as it's specified to do in the SDK !
| Quote: | I am 100% sure the content I'm playing does not have these black bars.
|
Yes, and I'm absolutely sure of that too - thanks for checking ;-)
| Quote: | stretchtofit set to false the video plays as I would expect (original aspect
ratio, no stretching).
|
My recommendation remains to set stretchToFit to false and see what
happens, along with >setting an explicit width and height< for your
WMP object.
Otherwise, please provide your strippped down code and I'll take a
look after xmas (we're all down the pub now !)
Cheers - Neil
| Quote: |
"Neil Smith [MVP Digital Media]" wrote:
On Fri, 23 Dec 2005 07:38:02 -0800, "Dave"
Dave@discussions.microsoft.com> wrote:
I have a question regarding the stretchtofit property. I am using VB .Net
and using the WMP object just fine. Is there any way to stretch playback to
the size of the control without maintaining the aspect ratio?
It should fill the control while distorting the aspect ratio, if you
make your object width and heigh as desired and set stretchToFit
false.
Say you had a video at 192x168 pixels, and you set your player UI
width and height to 192x200 pixels, it should be distorted. Is this
different from your experience ?
Cheers - Neil
|
|
|
| Back to top |
|
 |
Dave
Guest
|
Posted:
Tue Dec 27, 2005 9:30 pm Post subject:
Re: stretch to fit and aspect ratio |
|
|
My WMP object is called wmpDisplay. In the following code, if intWidth and
intHeight are larger than the video's native size (say 640x360) then the
video will not fill the component. When stretchToFit is set to True, the
video will be stretched until the width fills the object width, but the
height is stretched and keeps the aspect ratio (it is not fully stretched to
the object height).
wmpDisplay.Width = intWidth
wmpDisplay.Height = intHeight
wmpDisplay.Left = 0
wmpDisplay.Top = 0
wmpDisplay.stretchToFit = False
wmpDisplay.URL = strFileName
"Neil Smith [MVP Digital Media]" wrote:
| Quote: | On Fri, 23 Dec 2005 10:55:02 -0800, "Dave"
Dave@discussions.microsoft.com> wrote:
The stretch to fit property is not fully stretching the video. It appreas to
be stretching it until the width fills the screen and I'm left with black
bars on the top and bottom (16:9 video on a 4:3 screen, centered).
Thats exactly as it's specified to do in the SDK !
I am 100% sure the content I'm playing does not have these black bars.
Yes, and I'm absolutely sure of that too - thanks for checking ;-)
stretchtofit set to false the video plays as I would expect (original aspect
ratio, no stretching).
My recommendation remains to set stretchToFit to false and see what
happens, along with >setting an explicit width and height< for your
WMP object.
Otherwise, please provide your strippped down code and I'll take a
look after xmas (we're all down the pub now !)
Cheers - Neil
"Neil Smith [MVP Digital Media]" wrote:
On Fri, 23 Dec 2005 07:38:02 -0800, "Dave"
Dave@discussions.microsoft.com> wrote:
I have a question regarding the stretchtofit property. I am using VB .Net
and using the WMP object just fine. Is there any way to stretch playback to
the size of the control without maintaining the aspect ratio?
It should fill the control while distorting the aspect ratio, if you
make your object width and heigh as desired and set stretchToFit
false.
Say you had a video at 192x168 pixels, and you set your player UI
width and height to 192x200 pixels, it should be distorted. Is this
different from your experience ?
Cheers - Neil
|
|
|
| Back to top |
|
 |
|
|
|
|