我有现成的截图方法:
#region 与操作系统交互的函数的封装类
public class WIN32API
{
public const int HORZRES=8;
public const int VERTRES=10;
public const int SCRCOPY=0x00CC0020;
public const int LOGPIXELSX = 88;
public const int LOGPIXELSY = 90;
/// <summary>
/// 将一幅位图从一个设备场景复制到另一个
///</summary>
[DllImport("gdi32.dll")]
public static extern int StretchBlt(IntPtr hdc ,int x , int y , int nWidth , int nHeight , IntPtr hSrcDC , int xSrc , int ySrc , int nSrcWidth , int nSrcHeight , int dwRop );
/// <summary>
/// 将一幅位图从一个设备场景复制到另一个
/// </summary>
[DllImport("gdi32.dll")]
public static extern int BitBlt (IntPtr hDestDC ,int x, int y, int nWidth, int nHeight, IntPtr hSrcDC, int xSrc, int ySrc, int dwRopint);