图片和视频全屏?
)
我有一个应用程序来显示一些视频和图像..就像演示文稿..图像具有不同的分辨率和视频。我想将图像和视频置于全屏模式,但不损失质量。屏幕旋转很好,但媒体内容没有按应有的方式显示。
基本上我想显示以垂直和水平为中心的图像不损失质量..
建议?
)
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于视频,我建议使用 MediaElement,并将 Stretch 属性设置为“Uniform”。 “统一”占据了您提供控制的所有空间,但它确保视频保持其宽高比。您仍然应该拥有所有可能的质量,因为拉伸发生在 GPU 上并且它做得很好。您可以在此处查看示例:
http://msdn。 microsoft.com/en-us/library/system.windows.controls.mediaelement.aspx
现在,如果您希望视频仅放大到原始大小而不被放大得更大,那么只需设置将属性拉伸为“无”。
Image 控件的工作方式相同,并且也具有相同的 Stretch 属性。请参阅此处的 Image 类文档和示例:
http://msdn.microsoft.com/en-us/library/system.windows.controls.image(v=VS.95).aspx
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
您是否尝试过 < code>MediaElement API 以及
NaturalVideoHeight
和NaturalVideoWidth
属性?Did you try the
MediaElement
API and theNaturalVideoHeight
andNaturalVideoWidth
properties?