调用windows api 获取系统分辨率
c++中:
int cxScreen,cyScreen;
cxScreen=GetSystemMetrics(SM_CXSCREEN);
cyScreen=GetSystemMetrics(SM_CYSCREEN);
c#中:
[DllImport("user32")]
public static extern int GetSystemMetrics(int nIndex);
//获取分辨率宽度
int x = GetSystemMetrics(0);
//获取分辨路高度
int y = GetSystemMetrics(1);