CopyFromScreen method isn't affected by clipping region , why ??

Status
Not open for further replies.

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
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 ???
 

swatkat

Technomancer
I don't know anything related to .NET. But, Google lead me to this ;)
*www.dotnetcurry.com/ShowArticle.aspx?ID=117&AspxAutoDetectCookieSupport=1
Hope that helps....
 
OP
pavilion

pavilion

Broken In
Thanks ^^ but it's not exactly my situation , the tutorial in that link doesn't use clipping region
 
Status
Not open for further replies.
Top Bottom