如何取得当前窗口的分辨率?

zhangluheng 2004-05-06 09:09:42
如何取得当前窗口的分辨率,Graphics.DipX似乎不是分辨率,请指教
...全文
195 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
CMIC 2004-05-06
  • 打赏
  • 举报
回复
System.Drawing.Size mSize=SystemInformation.VirtualScreen.Size;
gis_2000 2004-05-06
  • 打赏
  • 举报
回复
System.Drawing.Rectangle rect = Screen.PrimaryScreen.Bounds;
BearRui 2004-05-06
  • 打赏
  • 举报
回复
using System.Runtime.InteropServices;

private const int SM_CXSCREEN = 0;
private const int SM_CYSCREEN = 1;

[DllImport("user32.dll")]
private static extern int GetSystemMetrics (int nIndex);
private void button1_Click(object sender, System.EventArgs e)
{ //屏幕宽
int iScreenX=GetSystemMetrics(SM_CXSCREEN);
//屏幕高
int iScreenY=GetSystemMetrics(SM_CYSCREEN);

Console.WriteLine("{0},{1}",iScreenX,iScreenY);
}

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧