Display Image in separate figure in app designer

21 ビュー (過去 30 日間)
Cedric Hauschopp
Cedric Hauschopp 2020 年 10 月 18 日
コメント済み: Image Analyst 2020 年 10 月 19 日
Hey there,
I want to display an image in app desginer like I would do it in this way:
[filename,pathname] = uigetfile({'*.*';'*.jpg';'*.tif';'*.gif';'*.png'},'Select Image');
i = imread([pathname,filename]);
f1 = figure;
imshow(i)
title('Image1');
I tried many ways to do it, but it won't work.
app.f1 = uifigure;
app.im1 = uiimage(app.f1);
app.i1 = imshow(app.i,'Parent',app.im1);
Also i need a default toolbar and menu, which the figure in app designer does not have.

採用された回答

Image Analyst
Image Analyst 2020 年 10 月 18 日
You can still call figure() in your code to bring up a separate figure, separate from your main GUI that you built with App Designer.
  2 件のコメント
Cedric Hauschopp
Cedric Hauschopp 2020 年 10 月 18 日
Thank you so much. Can't belive I did not try the easy way. Maybe because this warning pops up:
Specify a UIAxes as the value for 'Parent'.
Anyway thanks!
Image Analyst
Image Analyst 2020 年 10 月 19 日
Dont' specify a parent. Just rely on the new figure as being the current figure:
hFig = figure;
imshow(app.i);

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by