フィルターのクリア

When I use UIGETFILE function then the gui minimized how can I stop it to do this?

31 ビュー (過去 30 日間)
Ahmer Shahid
Ahmer Shahid 2019 年 1 月 12 日
回答済み: Moses Molatlhegi 2022 年 5 月 31 日
[filename,filepath]=uigetfile({'*.*'},'Select and image');
  2 件のコメント
TADA
TADA 2019 年 1 月 13 日
which GUI?
is this a gui taht runs this on a callback function?
what exactly are you running here?
Ahmer Shahid
Ahmer Shahid 2019 年 1 月 13 日
I am using app designer in Matlab 2018a and I replaces a button for upload image. When I push the button a screen open for select an image then when I select image the gui minimize but it's working because when I maximized it the image showing on axis.
This is the code in function..
[FileName, FilePath]= uigetfile({'*.jpg','*.bmp'}, 'Select a file');
if isnumeric(FileName); return; end
image = imread(fullfile(FilePath, FileName));
imshow(image,'parent',app.axes);

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

回答 (3 件)

Cody Lau
Cody Lau 2019 年 7 月 23 日
figure(app.UIFigure);
This should reopen the GUI windown after it minimises.
  1 件のコメント
Subhamoy Saha
Subhamoy Saha 2020 年 2 月 28 日
The problem is not with imshow() rather it is with uigetfile() function. I was also facing same issue with GUI built with both guide and appdesigner. Your solution works for me. Thanks!

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


Walter Roberson
Walter Roberson 2019 年 1 月 13 日
imshow() resizes the figure under the condition that "hold" is off and the axes is in the "default" position as-if it is the only axes in the figure.
To avoid this, either turn hold on for the axes, or make the axes a non-default size, or else (my recommendation) do not use imshow() for any purpose other than interactive exploration.
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 1 月 13 日
Which operating system are you using? uigetfile() uses operating system facilities in order to be consistent with system "look and feel"
Ahmer Shahid
Ahmer Shahid 2019 年 1 月 13 日
This one.
Capture.PNG

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


Moses Molatlhegi
Moses Molatlhegi 2022 年 5 月 31 日
This one also works for newer versions of matlab
figure(app.figure1);

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by