How to change current figure handle?

9 ビュー (過去 30 日間)
Prem Kumar
Prem Kumar 2017 年 4 月 1 日
コメント済み: Prem Kumar 2017 年 4 月 1 日
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 件のコメント
Stephen23
Stephen23 2017 年 4 月 1 日
編集済み: Stephen23 2017 年 4 月 1 日
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.

サインインしてコメントする。

採用された回答

Stephen23
Stephen23 2017 年 4 月 1 日
編集済み: Stephen23 2017 年 4 月 1 日
train_image = getimage(handles.axes1)
  1 件のコメント
Prem Kumar
Prem Kumar 2017 年 4 月 1 日
Thanks a lot. It worked

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by