图片和视频全屏?

发布于 2024-12-17 23:58:51 字数 151 浏览 8 评论 0原文

我有一个应用程序来显示一些视频和图像..就像演示文稿..图像具有不同的分辨率和视频。我想将图像和视频置于全屏模式,但不损失质量。屏幕旋转很好,但媒体内容没有按应有的方式显示。

基本上我想显示以垂直和水平为中心的图像不损失质量..

建议?

)

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黄昏下泛黄的笔记 2024-12-24 23:58:51

对于视频,我建议使用 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

抚笙 2024-12-24 23:58:51

您是否尝试过 < code>MediaElement API 以及 NaturalVideoHeightNaturalVideoWidth 属性?

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文