matlab web browser position and/or screenshot
이전 댓글 표시
Dear Community, I write you to ask if it is possible set or get the position of a current web browser, in order to take a screenshot of a web page, with some app like http://www.mathworks.com/matlabcentral/fileexchange/24323-screencapture-get-a-screen-capture-of-a-figure-frame-or-component or java.awt.Robot.createScreenCapture.
I really think that could pass by the web browser handle: [stat,browser_handle] = web(url);
but I didn't find the right method.
Thank you, Emanuele
답변 (1개)
Geoff Hayes
2016년 9월 21일
Emanuele - you can try the following which may be applicable to your version of MATLAB. For R2014a on OS X 10.11.6, you can use the methodsview method to view the methods for the browser which is an instance of com.mathworks.mde.webbrowser.WebBrowser.
>> methodsview('com.mathworks.mde.webbrowser.WebBrowser')
or
>> methodsview(browser_handle)
Either of the above will open a window with the methods for this class. The one of interest is getLocationOnScreen which returns a java.awt.Point which seems to represent the position of the top-left corner of the browser window. (You may need to experiment with this though in order to verify that this is exactly what you want.)
You can also use the methods getHeight() and getWidth() to get the height and width respectively of the browser window.
카테고리
도움말 센터 및 File Exchange에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!