matlab web browser position and/or screenshot
Mostrar comentarios más antiguos
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
Respuestas (1)
Geoff Hayes
el 21 de Sept. de 2016
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.
1 comentario
Emanuele Martini
el 21 de Sept. de 2016
Categorías
Más información sobre Web Services en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!