C#獲取Windows屏幕尺寸

在C#中,能夠使用System.Windows.SystemParameters獲取有關屏幕真實狀態的基本信息。orm

  1. 獲取屏幕像素:io

    使用
       SystemParameters.FullPrimaryScreenHeightform

              SystemParameters.FullPrimaryScreenWidthim

  2. 獲取工做區(不包括任務欄)像素:工作

    使用
     SystemParameters.WorkArea.Height
     SystemParameters.WorkArea.Width像素

 

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

相關文章
相關標籤/搜索