【发布时间】:2018-03-31 20:34:08
【问题描述】:
我正在开发一个程序,该程序可以在多个 chrome 窗口中打开多个 URL,我应该在这些窗口中截取这些窗口的屏幕截图并写入文件。 到目前为止,我能够在不同的 chrome 窗口中打开 URL,但我不知道如何以全屏模式/大小打开这些窗口。这样可以正确截取屏幕截图。有人可以帮忙吗? 我的代码:
Runtime runtime = Runtime.getRuntime();
try{//using try-catch as the target system might be of 32 bit or 64 bit
Process p = runtime.exec("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe -new-window "+url);
}catch(Exception ex){
Process p = runtime.exec("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe -new-window "+url);
}
【问题讨论】:
标签: java google-chrome