How to incorporate a picture into an inputdlg?

15 vues (au cours des 30 derniers jours)
beginner94
beginner94 le 13 Sep 2019
Commenté : Adam le 17 Sep 2019
Good morning,
did anyone already manage to incorporate a picture into an inputdlg or something similar?
The inputdlg is asking for dimensions and a picture could help to clarify which dimensions exactly are needed.
Thanks!
  2 commentaires
Ankit
Ankit le 17 Sep 2019
Whats your Use Case?
Alternatively, you can programmatically create a dialog box using figure, display picture and get input from user etc. and below you can find one such example.
f = figure('Units','Normalized',...
'Position',[.4 .4 .3 .3],...
'NumberTitle','off',...
'Name','Info');
e = uicontrol('Style','Edit',...
'Units','Normalized',...
'Position',[.1 .4 .3 .1],...
'Tag','myedit');
p = uicontrol('Style','PushButton',...
'Units','Normalized',...
'Position',[.6 .4 .3 .1],...
'String','Done',...
'CallBack','uiresume(gcbf)');
i = axes(f,'Units','Normalized',...
'Position',[.2 .2 .1 .1]);
uiwait(f)
out = str2num(get(e,'String'));
you can display image on axes using imshow
Best Regards
Ankit
Adam
Adam le 17 Sep 2019
inputdlg is just a simple what you see is what you get dialog box with no options to add to it. You'd need to create your own for that, as in the reply above

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by