how can i make a reset button in matlab gui?

1 visualización (últimos 30 días)
Abhishek Ghai
Abhishek Ghai el 9 de Jul. de 2016
Comentada: Image Analyst el 10 de Jul. de 2016
as i have two axes in gui & i uploaded an image on one axes. after that i performed some operation on that image like gray scaling & operated image is showing on my 2 axes. Now i want a code for reset pushbutton to get the original image on secondary axes i.e. the image which is showing on my 1 axes.

Respuesta aceptada

Image Analyst
Image Analyst el 9 de Jul. de 2016
Simply have the callback for your reset button call the same code that you originally did, namely imread() and imshow(), just call axes() first to switch to the second axes.
axes(handles.axes2)
originalImage = imread(fileName);
imshow(originalImage);
  2 comentarios
Abhishek Ghai
Abhishek Ghai el 10 de Jul. de 2016
bt i m getting an image from the user so wat coding should i do? that's the code to load an image from user & showing on 1 axes. so nw tell me the code for reset button to get an original image on secondary axes. global x axes(handles.org); [file,path]=uigetfile('*.jpg'); if file==0 msgbox('NO FILE SELECTED') else x =imread([path,file]); imshow(x); end
Image Analyst
Image Analyst el 10 de Jul. de 2016
You need to get the image from the function where you read it in over to your other axes. One way is to look at the FAQ http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
Another way is to use getimage():
axes(handles.axes1);
theImage = getimage();
axes(handles.axes2);
imshow(theImage);
Also, you might check your keyboard. Quite a few letters in your response are not showing up. Not only does it make your posts hard and slower to read, but it could introduce coding errors.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by