首页 > 其他 > 详细

Utils

时间:2014-07-13 09:42:59      阅读:397      评论:0      收藏:0      [点我收藏+]
using System;
using System.Drawing;
using System.Windows.Forms;


namespace zhbCapture
{
	/// <summary>
	/// Description of Utils.
	/// </summary>
	public class Utils
	{
		public static Bitmap screenBmp, srcScreenBmp;
		public static int screenWidth = Screen.PrimaryScreen.Bounds.Width;
		public static int screenHeight = Screen.PrimaryScreen.Bounds.Height;
		public static Size screenSize = Screen.PrimaryScreen.Bounds.Size;
        public static Point screenLocation = new Point(0, 0);
        public static Rectangle screenRect = new Rectangle(screenLocation, screenSize);
		public Utils()
		{
			
		}
		public static Bitmap getScreen(){
			
			Bitmap bitmap = new Bitmap(screenWidth, screenHeight);
			using (Graphics g = Graphics.FromImage(bitmap)) {
				g.CopyFromScreen(0,0,0,0,screenSize);
				return bitmap;
			}
		}
	}
}

  

Utils,布布扣,bubuko.com

Utils

原文:http://www.cnblogs.com/cause/p/3837872.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!