开发者

Repost of previous question: MediaElement in WPF

I am looking for a solution for a question that was already posted but did no开发者_高级运维t answer correctly, thanks in advance.

Show first frame of video in WPF MediaElement


The solution in the other thread should work but you could approach it differently.

Basically, to avoid having to load the video just to grab the first frame you could generate a static image that is the frame you want to show. If you are encoding the video most encoding software will generate a thumbnail for you for this purpose. If not you can screen shot a frame and use that

Then display that image in a normal WPF image control when the movie is not playing. When the user plays the video use a trigger to hide the image and show the video.

This will give you the effect you want.

Downside: This static image will get out of sync with the video if your video file is updated (you would need to regenerate the thumbnail in this case)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜