c# - 发送位图到directshow源过滤器
问题描述
寻找一种从代码发送位图而不将其作为直接显示输出源保存到文件的方法。
我从 Windows7.1SDK 中找到了示例“PushSource”,但它是用 C++ 编写的,甚至无法编译。
解决方案
The question is overly broad for detailed reply, but I will still outline the steps.
First, Push Source Filters are in good standing. They are buildable, but you might need to build BaseClasses project there first because it's a required dependency.
Then, PushSourceBitmap shows how to inject a bitmap into streaming pipeline. You are to extend the filter to be able to accept a bitmap externally, esp. with C# friendly interface such as COM interface.
Next thing is to realize that a filter is operating in a process that streaming pipeline, which might be different from the application that sends/produces the bitmap. If this is the case you are to care about interprocess communication, which might be not that trivial. Also, if multiple processes are involved there is a question of potential bitness mismatch and/or multiple senders.
As you mentioned source filter and C#, you might also be interested in looking at DirectShow.NET's GSSF: Generic Sample Source Filter:
The Generic Sample Source Filter - A way to implement a source filter in c#
推荐阅读
- dart - 在 Flutter 中按下按钮时如何显示透明布局?
- python - 如何让python一次识别多个字母
- python - 有什么有效的方法来计算大数据表列中的二进制值?
- android - tools:context=".MainActivity" 失败,我该如何解决?
- javascript - 在 if 语句中将索引作为数字返回
- mysql - 从两个表之一中选择相同的数据
- drupal - 登录提示在 Drupal 中丢失。那么有没有办法绕过呢?
- sql - 对如何使用授权语句使用密码进行另一个登录感到困惑
- typescript - TypeScript 构建类似 Promise.all 的函数 - 重载签名与函数实现不兼容
- json - 如何将多个参数传递给jq?