jpmd
jpmd

Reputation: 247

Image and video fullscreen?

)

I have a application to show some videos and images.. like a presentation.. The images have different resolution's and the videos to. I want to put the images and the videos in full screen mode but without lose quality.. The rotation of screen is fine, but the media content does not appear like they should..

Basically i want to show the images centered in vertical and horizontal without lose quality..

Suggestions?

Upvotes: 0

Views: 1054

Answers (2)

Jared Bienz - MSFT
Jared Bienz - MSFT

Reputation: 3550

For the video I would recommend using a MediaElement with the Stretch attribute set to 'Uniform'. 'Uniform' takes up all the space that you give the control but it ensures that the video maintains its aspect ratio. You should still have all the qaulity possible because the stretching happens on the GPU and it does a great job. You can see an example here:

http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.aspx

Now, if you want the video to only scale up to it's orignial size but not get blown up any larger, then just set the Stretch property to 'None'.

The Image control works the same way and also has the same Stretch property. See the Image class documentation and sample here:

http://msdn.microsoft.com/en-us/library/system.windows.controls.image(v=VS.95).aspx

Upvotes: 1

abhinav
abhinav

Reputation: 3217

Did you try the MediaElement API and the NaturalVideoHeight and NaturalVideoWidth properties?

Upvotes: 1

Related Questions