Hi,
I use a load image button in GUI that contains the following code:
[path, file] = uigetfile({'*.jpg;*.gif','All Image Files'},' Select image')imgFile = strcat(path,file);I = imread(imgFile);imgInfo = imfinfo(imgFile);x=imgInfo.ColorType;while x=='grayscale' uiwait(warndlg('Please select a color image'));end
I have to two problems: 1) When I click a grayscale image the warning dialog popups but I have to press the load image button in order to cancel it. I wish to click the ok causing the warning dialog to disappear. How do I do it? 2) When I exit run of the matlab code the warning dialog still appears and I cannot closed it. How to solve it?
Thanks.
Best Answer