pavilion
Broken In
I want to copy a portion of desktop screen and draw it on form (that portion can be in rectangular , elliptic or freeform shape ) , so I have to use a clipping region because the method just copy a rectangle portion from screen . Sound easy , I hope you understand
First I used APIs : SelectClipRgn and BitBlt , everything's done perfectly . Then I tried to make it in .NET way , use CopyFromScreen method and Graphics.SetClip . But it appear that the CopyFromScreen method isn't affected by clipping region . For example
You see, I copy a 500x500 rectangle from screen into a 100x100 clipping region , but the form still draw the 500x500 rectange ???
First I used APIs : SelectClipRgn and BitBlt , everything's done perfectly . Then I tried to make it in .NET way , use CopyFromScreen method and Graphics.SetClip . But it appear that the CopyFromScreen method isn't affected by clipping region . For example
Code:
Graphics w = this.CreateGraphics;
w.SetClip(new Rectangle(0, 0, 100, 100);
w.CopyFromScreen(0, 0, 0, 0, new Size(500, 500));