How to incorporate a picture into an inputdlg?
13 次查看(过去 30 天)
显示 更早的评论
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 个评论
Ankit
2019-9-17
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
2019-9-17
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!