0

I am converting my Win32 GDI implementation to C# WPF with DrawingContext. However, one thing that I am not sure is whether the DrawingContext supports ROP2 mode or something similar. If not, what is the alternative implementation without using canvas?

The main purpose of using ROP2 mode is to draw a rectangle with moving mouse cursor.

Jim
  • 1
  • What do you mean by "ROP2" mode? – Dai Mar 20 '22 at 04:53
  • @Dai It's a GDI feature, similar to Alpha blending in GDI+ (e.g., [SetROP2](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-setrop2)) -- Used to blend the drawing with a background. Can be masked and/or XORed. – Jimi Mar 20 '22 at 11:31
  • Thank you for explanation. For example, in a chart, you need to draw a rectangle with mouse to allow zoom in to the area, In the Win32 GDI world, you can use ROP2 to manipulate the pixels to display a moving rectangle without refreshing the whole control. My current solution is to use rectangle on a canvas on top of the DrawingContext rendering. After a few tweaks, I was able to make the rectangle object response to mouse move. This will make my simple charts work. I have more issues from other complicated charts to be solved. – Jim Mar 21 '22 at 02:56

0 Answers0