Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: changing position of a image
Date: Sun, 30 Nov 2008 07:55:07 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 29
Message-ID: <ggtgsr$3in$1@fred.mathworks.com>
References: <ggsqge$hrt$1@fred.mathworks.com> <ggssrd$h2g$1@fred.mathworks.com> <ggsuei$2u8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228031707 3671 172.30.248.37 (30 Nov 2008 07:55:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Nov 2008 07:55:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:503880


"Rui Gomes" <rpgomes84@gmail.com> wrote in message <ggsuei$2u8$1@fred.mathworks.com>...
> 
> im making some experiences
> and when i put im guide .m file:
> 
> handles.redI = imread('red_spot.jpg');
> pos_act =get(handles.axes3,'Position')
> set(handles.axes3,'Position',[111 111 pos_act(3) pos_act(4)]);
> image(handles.redI);
> axis off;
> 
> my image dissipates, and the image that i had associate in handles.axes3 and to change position several times.
> 
> i don't know what to do, im to novice in matlab guide.
> the image is only a red point that i want to put in front of the image that is in handles.axes2

I think you need to put these 3 commands in the portion of your GUIDE code other than the Callback (such as CreateFcn for the axes).

handles.redI = imread('red_spot.jpg');
image(handles.redI);
axis off;

Then, in ButtonDownFcn for Axes 1 (assuming Axes 1 and 2 are the same size),

cursorPos = get(handles.axes1, 'CurrentPosition')
pos_act =get(handles.axes3,'Position')
set(handles.axes3,'Position',[111 111 pos_act(3) pos_act(4)]);

I think that covers the basic idea, but there is more too it than that, so I'll post an example code that you can run.