使用DirectShow.NET在C#的IVideoWindow上显示半透明的Image对象 [英] Showing a semi-transparent Image object over an IVideoWindow in C# using DirectShow.NET

查看:100
本文介绍了使用DirectShow.NET在C#的IVideoWindow上显示半透明的Image对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用DirectShow.NET与C#中的网络摄像头进行交互,到目前为止,一切都进行得很顺利。但是,现在,我正在尝试建立一种裁剪图像的方法(尽管该图像仍在显示为网络摄像头预览)。

I've been using DirectShow.NET to interface with a webcam in C# and so far everything has been going smoothly. However, right now I'm working on trying to set up a method to "crop" an image (while it's still being displayed as a webcam preview).

基本上,我试图在IVideoWindow对象的顶部显示某种基本透明的图像。但是,使用C#来处理透明性还差得很远。

Basically, I'm trying to show some kind of a mostly transparent image on top of the IVideoWindow object. Dealing with transparency in C#, however, has been pretty far from a cakewalk.

那么,如何在IVideoWindow之上层叠Image对象?谢谢!

So, how can I layer an Image object on top of an IVideoWindow? Thanks!

推荐答案

有两种方法可以实现此目的:

There are two approaches how to achieve this:


  • 可以使用视频转换过滤器并将混合的视频传递到渲染器(即图片+您的叠加层)

  • 或使用VMR的 mixerbitmap功能来在演示时覆盖

DirectShow.NET 具有上面提到的第二个示例:

DirectShow.NET has a sample for the second mentioned above:


示例\ VMR9\BitMapMixer
BitmapMixer是如何使用VMR9在视频上绘制内容的示例。

Samples\VMR9\BitMapMixer BitmapMixer is an example of how to draw things over a video using VMR9.

那里的另一个示例:


示例\播放器\DxText
一个示例应用程序,展示了如何在数据流上叠加文本字符串。流是从avi文件中读取的。

Samples\Players\DxText A sample application showing how to superimpose text strings on a datastream. The stream is read from an avi file.

MSDN论坛

这篇关于使用DirectShow.NET在C#的IVideoWindow上显示半透明的Image对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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