How to change current figure handle?

9 vues (au cours des 30 derniers jours)
Prem Kumar
Prem Kumar le 1 Avr 2017
Commenté : Prem Kumar le 1 Avr 2017
I want to get image from a handle named axes1 in my code. How can I use gcf to get that image? I tried this but it is not working:
axes(handles.axes1);
train_image=getimage(gcf);
The image I am getting is from another axes(not axes1). Please help.
  1 commentaire
Stephen23
Stephen23 le 1 Avr 2017
Modifié(e) : Stephen23 le 1 Avr 2017
Do no use gcf or gca for code that you want to work properly. Always obtain, pass, and use graphics handles explicitly for all of your GUI objects.

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 1 Avr 2017
Modifié(e) : Stephen23 le 1 Avr 2017
train_image = getimage(handles.axes1)
  1 commentaire
Prem Kumar
Prem Kumar le 1 Avr 2017
Thanks a lot. It worked

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects 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!

Translated by