有没有办法用 100% 托管代码编写 BitmapEffect?

发布于 2024-07-06 03:39:58 字数 186 浏览 5 评论 0原文

有没有办法用 100% 托管代码编写 BitmapEffect? 我知道它比使用非托管代码运行得慢很多,但我想编写一个 BitmapEffect,但自从我完成任何 C++ 编程以来已经很长时间了,而且应用程序可能必须在部分信任的情况下运行(所以不允许使用非托管代码)。 该效果很少在静态内容上运行。 只需获取渲染内容的位图并返回更改内容的位图就足够了。

Is there a way to write a BitmapEffect in 100% Managed Code? I know that it would run a lot slower than using unmanaged code, but I'd like to write a BitmapEffect but its been a long time since I've done any C++ programing, plus the application might have to run in partial trust (so unmanaged code won't be permissible). The effect is going to be run very rarely on static content. Simply getting the Bitmap of the rendered content and handing back a bitmap of the altered content would suffice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三岁铭 2024-07-13 03:39:58

您可以使用 RGBFilter 作为起点 - 自定义位图效果示例,用 C++ 和 C# 编写。

我不确定您是否只能在 C# 中实现自定义位图效果,因为它需要实现一些 MIL 接口,而这在 C# 中可能无法实现。 尽管我可能是错的。

You can use as your starting point the RGBFilter - a custom bitmap effect sample, written in C++ and C#.

I am not sure you can implement custom bitmap effect in C# only, as it requires implementing some MIL interfaces, which might not be doable in C#. Though I might be wrong about that.

时光无声 2024-07-13 03:39:58

在您走这条路之前,您是否看过以下内容:

基于 GPU 的效果

这是一系列有关将效果(在 .NET 3.5SP1 中受支持)编写为在 GPU 上运行的片段着色器的文章...非常简洁的东西!

Before you go that route, have you seen this:

GPU based effects

It's a series of articles about writing Effects (supported in .NET 3.5SP1) as fragment shaders that run on your GPU... Pretty neat stuff!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文