tags:

views:

208

answers:

2

Is there a way to invert a region of the screen using WPF? In Win32, I would do BitBlt ( .... DSTINVERT ...). Of course, I would use Interop but that seems pretty messy.

+4  A: 

I'd look at using Pixel Shaders. They're GPU optimized so they will likely run more quickly. There's an InvertImage effect available on CodePlex.

Jon Galloway
Does it work with .NET 3.5?
tom greene
(I meant to say) Does it work with .NET 3.0?
tom greene
No, it requires .NET 3.5 SP1. I think the "WPF way" to do it in .NET 3.0 is to use a CustomBitmapEffect (http://msdn.microsoft.com/en-us/library/ms771475.aspx), but there may be a better way.
Jon Galloway
+2  A: 

You might want to investigate System.Windows.Forms.ControlPaint.FillReversibleRectangle. It's not WPF, but it is .NET and "less messy".

Michael McCloskey