Tuesday, July 20, 2004

GDI+ Doesn't XOR

Recently I am writing a screen capture program capture in C#. I notice GDI+ is missing one very important function.

It doesn't support drawing using XOR mode. What a big limitation! That mean now I got to research into how to do that using PInvoke. There is a SetROP2 function in GDI32 but using that with manage code pose a new set of complexities on its own.

The other workaround is that I have to save the state of the drawing surface into a Bitmap. But using this technique to draw a wireframe everytime the mouse move on the drawing surface is going to cause my app a big GC hit as everytime the mouse move, I got to dispose and create new Bitmap object to save the state of the drawing surface.

Any of you guys have any solution to this XOR problem?

Labels: ,

0 Comments:

Post a Comment

<< Home