|
-
September 24th, 2008, 02:41 AM
#1
CopyFromScreen method isn't affected by clipping region , why ??
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
Code:
Graphics w = this.CreateGraphics;
w.SetClip(new Rectangle(0, 0, 100, 100);
w.CopyFromScreen(0, 0, 0, 0, new Size(500, 500));
You see, I copy a 500x500 rectangle from screen into a 100x100 clipping region , but the form still draw the 500x500 rectange ???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|