各位大虾,请问在.Net如何实现在屏幕上任何地方画图?
我利用了USER32.DLL和GDI32.DLL,为什么这样看不到矩形??
能否给出提示,谢谢
IntPtr hDC = PlatformInvokeUSER32.GetDC(PlatformInvokeUSER32.GetDesktopWindow());
Graphics m_Graphics=Graphics.FromHdc(hDC);
Pen redPen=new Pen(Color.Red, 10);
Rectangle rWorkArea = Screen.GetWorkingArea(Screen.PrimaryScreen.WorkingArea);
m_Graphics.DrawRectangle(redPen,rWorkArea);
PlatformInvokeUSER32.ReleaseDC(PlatformInvokeUSER32.GetDesktopWindow(), hDC);