zoukankan      html  css  js  c++  java
  • WINFORM中几句程序获取整个屏幕的图片及当前窗口的图片快照

      /// <summary>

            /// 获取整个屏幕的图片
            /// </summary>
            /// <returns></returns>
            public static Image GetScreenImage()
            {
                Image image = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                Graphics g = Graphics.FromImage(image);

                g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.PrimaryScreen.Bounds.Size);

                return image;

            }

            public static Image GetWinformImage()
            {

                //获取当前屏幕的图像
                 Bitmap b = new Bitmap(this.Width, this.Height);
                 this.DrawToBitmap(b, new Rectangle(0, 0, this.Width, this.Height));
                 //b.Save(yourFileName);

                 return b;

             }

  • 相关阅读:
    android kl文件
    ELF文件结构描述
    jquery开头
    win7无声音显示“未插入扬声器或耳机” 怎么解决
    xhtml头文件设置
    break和continue的区别
    php目录函数
    mysql语法
    php中怎么导入自己写的类
    截取文件后缀名
  • 原文地址:https://www.cnblogs.com/liuruitao/p/3818304.html
Copyright © 2011-2022 走看看