views:

638

answers:

2

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.

Thanks!

+1  A: 

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!

dicroce
+1  A: 

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.

Franci Penov