Screenshot of specific window (not full screen)
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
René Lampert
le 17 Sep 2022
Modifié(e) : Image Analyst
le 17 Sep 2022
Hello,
is it possible to take a screenshot (I used Java commands) of only a specific Window (not the entire screen) ? - for instance, from the full screen below I only want to take a screenshot from the pop-up screen (GUI window)
To take a screenshot from the full window I used the following commands:
robo = java.awt.Robot;
t = java.awt.Toolkit.getDefaultToolkit();
rectangle = java.awt.Rectangle(t.getScreenSize());
image = robo.createScreenCapture(rectangle);
Thanks
0 commentaires
Réponse acceptée
Image Analyst
le 17 Sep 2022
Modifié(e) : Image Analyst
le 17 Sep 2022
fileName = fullfile(pwd, 'Screenshot.png')
exportgraphics(gcf, fileName); % Save current figure window.
% or
exportgraphics(gca, fileName); % Save last axes you plotted in.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!