Access image information in multiply pushbuttons-Howto

1 次查看(过去 30 天)
Dear All,
I have a GUI pushbutton that allows me to choose an image (I) and shows it in Axes. I wish to use the same image (I) information for another operation using another pushbutton without the necessity to call it again but it can not access it. How can I do it.
Thanks.
  1 个评论
Jan
Jan 2013-2-6
This is a vague question yet. Without the necessity to call wahat again? And what cannot access what?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2013-2-6

更多回答(1 个)

Jan
Jan 2013-2-6
I guess, that you want to store the image data in the GUI figure:
img = imread(FileName);
axes;
image(img);
handles.image_data = img;
guidata(hObject, handles);
Now you can access the image data from each other callback:
function yourcallback(hObject, EventData, handles)
handles = guidata(hObject);
disp(handles.image_data);
But perhaps you want something completely different.

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by