C#获取Windows屏幕尺寸

在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; 

posted @ 2015-03-11 09:48  网络行者  阅读(2108)  评论(0编辑  收藏  举报