Quick GUI copying in C #?

Now I am copying window graphics from one window to another through BitBltfrom WinApi. I wonder if there is any other quick / quick way to do the same in C #.

Keyword performance . If I stayed with WinApi, I would have saved it HDCin memory for quick drawing, and if the .NET Framework has other features, I would probably have objects Graphics. Right now I'm slowing down something when I have to copy windows to 1920x1080.

So, how can I improve gui copy performance in C #?
I just want to know if I can get any better than this. Explicit hardware acceleration (OpenGL, DirectX) is not for me here. I decided to stay clean .NET + WinApi.

// example to copy desktop to window
Graphics g = Graphics.FromHwnd(Handle);
IntPtr dc = g.GetHdc();
IntPtr dc0 = Windows.GetWindowDC(Windows.GetDesktopWindow());
Windows.BitBlt(dc, 0, 0, Width, Height, dc0, 0, 0, Windows.SRCCOPY);
// clean up of DCs and Graphics left out

Hans Questions:

  • How slow?
    • . ().
  • ?
    • .
  • ?
    • .
  • ?
    • .
  • ?
    • , Windows. , ?
+3
1

!

GDI, , .Net, , . , , , -. , , ( , ).

.Net- , .

, , , .

, , , , .

, ? ?

, , ? (.. ) . , , , .

+1

All Articles