How to capture the screen

  • Thread starter Thread starter Tomomichi Amano
  • Start date Start date
T

Tomomichi Amano

I asked how to "capture the screen" and a kind person replyed and told me to
use the code at http://www.c-sharpcorner.com/Code/2003/Dec/ScreenCapture.asp
I tried to use the code, but when I build the code, it says "User32" is not
found, so I can't load the program. Exactly, how can I use this code? (I'm a
beginner)
Also, if there are anyother codes that I can use to capture the screen,
please send it to me.
Thank you in advance.
 
Hi, the code is missing a closing brace to end the GDI32 class. Try with the
following (only the } is new, the rest is just to show where in the code it
is):

---

public static extern int SelectObject(int hdc,int hgdiobj);

}

class User32

---

now derive a new Example and use the CaptureScreen as follows:

Example capScreen = new Example();

capScreen.CaptureScreen("c:\\test.bmp", ImageFormat.Bmp);

Hope this helps!
 
Back
Top