我正在寻找如何在我的界面的特定区域中的GUI中显示图像。在特定区域使用GUI显示图像
0
A
回答
3
在GUIDE中,可以在GUI中绘制坐标轴。然后,在回调函数中,可以将图像绘制到轴上。个人而言,我宁愿没有GUI内部的图像,因为它会让所有事情都变得更加困难,如果您想仔细观察图像,或者抓住它来粘贴到另一个应用程序中,该图作为GUI的一部分可能不方便。因此,我更喜欢将图像在单独的数字窗口中打开。
0
试试下面的代码:
function movingimage
%# Plotting a figure
fig1=figure('Name','Plotting an image',...
'Unit','normalized', 'Position',[.1 .1 .8 .8]);
uicontrol(fig1,'Style','text','Unit','Normalized',...
'Position',[.9 .85 .1 .07],'String','Press the button below to move the image location.');
uicontrol(fig1,'Style','pushbutton','Unit','Normalized',...
'Position',[.9 .8 .05 .05],'String','Move','Callback',{@action_Callback});
%# Say, you wish to plot an image of relative dimension (.3 x .3) to the figure.
xdim=.3; ydim=.3;
%# Image's movable range in x is (1 - xdim)
dx=1-xdim;
%# Image's Movable range in y is (1 - ydim)
dy=1-ydim;
%# considering the size of the image...
pos = [.5*dx .5*dy xdim ydim]; %# Initial location of the image is at the center of the figure.
ax1 = axes('position',pos);
img = load('mandrill');
image(img.X)
colormap(img.map);axis off;axis equal;
function action_Callback(hObj,eventdata)
pos=[rand(1)*dx rand(1)*dy xdim ydim];
set(ax1,'position',pos);
end
end
0
最直接和最简单的方法,我觉得这样做是使用轴分量如本教程:
http://www.aboutcodes.com/2012/06/how-to-display-image-in-gui-using.html
相关问题
- 1. 使用MapKit显示特定区域
- 2. 如何使用CSS在图像上显示区域
- 3. 在Google地图上显示特定区域
- 4. 如何在Picturebox中定义的区域内显示图像?
- 5. GUI图像显示错误
- 6. 如何使用Tess4j识别图像中的特定区域java
- 7. CSS或JavaScript来突出显示特定区域的图像不透明度
- 8. 编辑地图只显示特定区域/位置
- 9. Android在ViewPager中显示特定图像
- 10. 如何在PyQT GUI中显示图像?
- 11. 在gui中的Matlab显示图像
- 12. 在gtk中显示图像 - 是否需要gtk绘图区域?
- 13. 如何使NSDateFormatter显示区域特定的日期?
- 14. 如何在python2.7上使用tk显示gui上的图像
- 15. Imagemap;当悬停在特定区域时显示文本
- 16. 在特定区域显示我的下拉框
- 17. 如何在iPhone中显示UIImageView中的特定区域?
- 18. 试图突出显示图像地图区域,而beeing响应
- 19. 限制图像特定区域的像素着色器
- 20. 需要突出显示使用Dot Net技术的JQuery中的鼠标移动图像的特定区域
- 21. 如何在UWP中将特定区域视为图像?
- 22. 如何在特定区域填充图像颜色?
- 23. 如何使用Eclipse在GUI中添加图像?此代码未显示图像
- 24. 在ASP.Net中突出显示图像上的区域
- 25. 嵌入式图像在便携式区域未显示部署
- 26. Safari在我的图像下显示空白区域?
- 27. 在图像上指定区域
- 28. 确定CGPoint是否在图像区域
- 29. 在图像中定义区域
- 30. 显示特定于NSString值的图像
像一个按钮?或者就像你的GUI界面中的情节一样? – Doresoom 2010-05-27 20:45:19
谢谢我发现它。 – Achraf 2010-05-27 21:17:16