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 Kommentar

Stephen23
Stephen23 am 1 Apr. 2017
Bearbeitet: Stephen23 am 1 Apr. 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.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Stephen23
Stephen23 am 1 Apr. 2017
Bearbeitet: Stephen23 am 1 Apr. 2017

1 Stimme

train_image = getimage(handles.axes1)

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by