码迷,mamicode.com
首页 > Windows程序 > 详细

C#获取Windows屏幕尺寸

时间:2015-03-11 10:32:41      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:

在C#中,可以使用System.Windows.SystemParameters获取有关屏幕真实状态的基本信息。

  1. 获取屏幕像素:

    使用
       SystemParameters.FullPrimaryScreenHeight

              SystemParameters.FullPrimaryScreenWidth

  2. 获取工作区(不包括任务栏)像素:

    使用
     SystemParameters.WorkArea.Height
     SystemParameters.WorkArea.Width

 

C# 获得屏幕大小 
Rectangle rect=System.Windows.Forms.SystemInformation.VirtualScreen; 
int width=rect.Width; 
int height=rect.Height; 

C#获取Windows屏幕尺寸

标签:

原文地址:http://www.cnblogs.com/haifan1984/p/4329039.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!