声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 941|回复: 1

请教一下GUI的一个重绘问题

[复制链接]
发表于 2006-5-12 11:46 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
我在一个figure里面,用imread载入一个图像,然后用rbbox选择了一个区域用进行处理,但这时如果重选,原来选择的区域还是给框着,有没有什么办法让rbbox重选时,取消原来选择的框,只显示原来的图像。<BR>下面是部分代码<BR>k = waitforbuttonpress;<BR>point1 = get(gca,'CurrentPoint');    % button down detected<BR>finalRect = rbbox;                   % return figure units<BR>point2 = get(gca,'CurrentPoint');    % button up detected<BR>point1 = point1(1,1:2);              % extract x and y<BR>point2 = point2(1,1:2);<BR>p1 = min(point1,point2);             % calculate locations<BR>offset = abs(point1-point2);         % and dimensions<BR>x = [p1(1) p1(1)+offset(1) p1(1)+offset(1) p1(1) p1(1)];<BR>y = [p1(2) p1(2) p1(2)+offset(2) p1(2)+offset(2) p1(2)];<BR>hold on<BR>axis manual<BR>plot(x,y)                            % redraw in dataspace units<BR><BR>-----------------------<BR>谢谢各位高手不吝指教
回复
分享到:

使用道具 举报

发表于 2006-5-13 14:36 | 显示全部楼层

回复:(aneye)请教一下GUI的一个重绘问题

没太懂你的意思,你给的这部分代码也不能运行
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-25 19:25 , Processed in 0.061708 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表