在WPF中裁剪视频片段 [英] Cropping video footage in WPF

查看:227
本文介绍了在WPF中裁剪视频片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我才刚开始使用WPF,我发现它非常有用且明确,特别是对于创建丰富的UI和交互式3D对象.

Hi, i'm just start to using WPF and I found it very useful and clear specially for creating rich UI and interactive 3D objects.

但是现在我有一个我无法解决的问题.

But now i have a problem i can't figured out.

在WPF中,我可以定义视频源(MediaElement或MediaPlayer)并将其绘制在3d曲面或2d控件上.

In WPF I can define a video source (MediaElement or MediaPlayer) and draw it on a 3d surface or 2d controls.

我不能做的是仅绘制视频的一部分(对于部分,我的意思是尺寸而不是长度).我试图更好地向我解释...

What I can't do is draw only a portion of the video (for portion i mean size not length). I try to explain me better...

我想将我的素材(400x400像素)细分为3部分.
1)左上角100x100像素(位置X = 0,Y = 0)
2)右上角300x100像素(位置X = 100,Y = 0)
3)所有底部的像素均为400x300(位置X = 0,Y = 100)

I want to subdivide my footage (400x400 pixel) in 3 parts.
1) 100x100 pixel in the top-left corner (Position X=0, Y=0)
2) 300x100 pixel in the top-right corner (Position X=100, Y=0)
3) 400x300 pixel all the bottom part (Position X=0, Y=100)

然后,我需要在放置在窗口中的3个不同3D对象上绘制此零件.

Then I need to draw this parts on 3 different 3D objects positioned in my window.

播放视频源时,我的3个对象必须填充同一视频的3个不同部分.

When I play the video source my 3 objects must be filled with 3 different part of the same video. 

可以这样做吗?

 

谢谢

Michele Massari

Michele Massari

推荐答案

我认为这不太容易.您可以从视频中检索图像,然后进行裁剪并相应显示图像.您可以将Directshow用于此任务.

I don't think it would be too easy. You can retrieve images from the video and then crop and display the images accordingly. You can use Directshow for this task.


这篇关于在WPF中裁剪视频片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆