如何将图像插入MediaElement [英] How to insert an image into a MediaElement
本文介绍了如何将图像插入MediaElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我有一个MediaElement查询.
我想在控件播放视频时将图像/文本添加到MediaElement中.
这样的想法:
[图片链接]
如果这不可能或您有任何其他想法,请发表评论
Hello, I have a query with MediaElement.
I want to add an image/text into the MediaElement while the control is playing a video.
Somethink like that:
[Image Link]
If this isn''t possible or you have any other idea, please comment
推荐答案
您的链接不起作用/.
作为WPF,您可以将图像放置在媒体元素上方,如果它是具有透明度的PNG,则图像将显示在视频上方.您可以在控件上设置Canvas.ZIndex来设置其顺序,这与直观的IMO相去甚远.
*由Mark S编辑*
我通常使用Grid将一个元素覆盖在另一个元素上,如Christian描述的那样,如下所示:
your link does not work/.
As it''s WPF, you can place an image above the media element, and if it is a PNG with transparency, your image will appear above the video. You set Canvas.ZIndex on your controls to set their order, which is far from intuitive IMO.
*Edit by Mark S*
I usually use a Grid to overlay an element on another element as Christian described, something like this:
<Grid>
<MediaElement />
<Image />
</Grid>
这篇关于如何将图像插入MediaElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文