日期:2014-05-17  浏览次数:20695 次

找到一个截全屏代码,不过不会用,谁救一下新人?
  public static Bitmap CopyPrimaryScreen()
        {
            Screen s = Screen.PrimaryScreen;
            Rectangle r = s.Bounds;
            int w = r.Width;
            int h = r.Height;
            Bitmap bmp = new Bitmap(w, h);
            Graphics g = Graphics.FromImage(bmp);
            g.CopyFromScreen
            (
            new Point(0, 0),
            new Point(0, 0),
            new Size(w, h)
            );
            return bmp;
        }


==========================================================
创个按键点击使用上面代码,保存到C盘A.BMP。不会搞,谁会教一下,谢谢啦

------解决方案--------------------
参考:http://www.cnblogs.com/zhili/p/CaptureTool.html
------解决方案--------------------

btnClick:
    Bitmap bitmap=CopyPrimaryScreen();
    bitmap.Save("C:\\A.bmp");
    bitmap.Dispose();

------解决方案--------------------

public static Bitmap CopyPrimaryScreen()
{
    Screen s = Screen.PrimaryScreen;
    Rectangle r = s.Bounds;
    int w = r.Width;
    int h = r.Height;