//以下两个函数获取的是显示屏幕的大小,不包括任务栏等区域 int screenwidth=GetSystemMetrics(SM_CXFULLSCREEN); int screenheight=GetSystemMetrics(SM_CYFULLSCREEN); //以下两个函数获取的是真正屏幕的大小,即实际的大小 int screenwidth_real=GetSystemMetrics(SM_CXSCREEN); int screenheight_real=GetSystemMetrics…
官方API: A structure describing general information about a display, such as its size, density, and font scaling. To access the DisplayMetrics members, initialize an object like this: DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().g…
原文 JS获取当前对象大小以及屏幕分辨率等 <script type="text/javascript">function getInfo(){ var s = ""; s += " 网页可见区域宽:"+ document.body.clientWidth+"\n"; s += " 网页可见区域高:"+ document.body.clien…