フィルターのクリア

How to make a push button to display an image.

3 ビュー (過去 30 日間)
nurul hafizah
nurul hafizah 2015 年 5 月 9 日
回答済み: Walter Roberson 2015 年 5 月 9 日
I want to create a GUI that have 2 push button, 2 axes to display images. the first push button (pb_load) is to load an image and display it in axes1.
if true
[filename pathname] = uigetfile ({'*.jpg';'*.bmp';'*.gif'}, 'Pick an Image');
myImage=strcat(pathname,filename);
axes(handles.axis1);
imshow(myImage);
set(handles.axis1,'visible','off');
guidata(hObject, handles);
end
the second push button is to change the image into R image and display it in axes2.
I do not know the coding that I can use for the push button 2. I also want the axes do not show x-axis and y-axis. But i do not know how.

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 5 月 9 日
imagehandle = findobj(axes(handles.axis1),'type','image');
imagedata = get(imagehandle, 'CData');
newimagedata = 255 - imagedata; %some transformation since I do not know what "R image" means
newimagehandle = imshow(newimagedata, 'Parent', handles.axes2);
set(handles.axes2, 'Visible', 'off');

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by