我正在尝试为我的屏幕捕获程序获取多显示器设置中左上角位置的坐标。这是我目前为该程序获得的内容:
int dwidth = 0, dheight = 0; //max dimensions of all monitors
for (GraphicsDevice gd : GraphicsEnvironment
.getLocalGraphicsEnvironment().getScreenDevices()) {
if (gd == GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()) {
minx = -width; //My attempt at finding the minimum X value did not work
}
dwidth += gd.getDisplayMode().getWidth();
dheight += gd.getDisplayMode().getHeight();
}
基本上我希望能够在所有监视器上运行我的程序。在此处查看完整代码:https ://gist.github.com/fletchto99/5788659