注册 登录
编程论坛 Matlab

求助,怎样用gui显示一个图像?能解释一下这段程序么?谢谢

danender 发布于 2007-08-28 15:55, 949 次点击
set(hObject, 'Units', 'pixels');
handles.banner = imread([matlabroot filesep 'demos' filesep
'banner.jpg']); % Read the image file banner.jpg
info = imfinfo([matlabroot filesep 'demos' filesep
'banner.jpg']); % Determine the size of the image file
position = get(hObject, 'Position');
set(hObject, 'Position', [position(1:2) info.Width + 100
info.Height + 100]);
axes(handles.axes1);
image(handles.banner)
set(handles.axes1, ...
'Visible', 'off', ...
'Units', 'pixels', ...
'Position', [50 50 info.Width info.Height]);
在具体执行的时候应该怎么用呢?能给一个真实的例子么?
1 回复
#2
xiaofu_haha2007-09-12 15:49

I=imread('图象的路径');
axes(handles.axes1);
imread(I);

1