Greetings,
I'm actually trying to display two images in two different axes in the GUI. Two push button were created to display image1 and image2 to axes1 and axes2 respectively. The problem is, I could not set the displayed image on the axes I intended to. The image will only be displayed on the current active axis, meaning that the image will be displayed only on one axis that is active. If I click on the second axis, the image will be displayed on the second axis replacing each other (image) according to the push button I clicked. Maybe the problem is because I do not know on how to set the axes1 and axes2 to respective image I want to display.
My current code is as shown below:
%pushbutton1 callback
function pushbutton1_Callback(hObject, eventdata, handles)
pic1=imread ('image1.png');
image (pic1);
axis off;
guidata(hObject,handles)
%pushbutton2 callback
function pushbutton2_Callback(hObject, eventdata, handles)
pic2=imread ('image2.png');
image (pic2);
axis off;
guidata(hObject,handles)
--------------------------------------------------------------------
My current GUI only consist of two axes, two push button and a static text. The tags are axes1, axes2, pushbutton1, pushbutton2 and text1 respectively.
Thanks in advance.
|
|
1
|
|
|
|
Reply
|
Mohd
|
2/3/2011 2:08:03 PM |
|
On Feb 3, 9:08=A0am, "Mohd Hanif" <hanif_za...@yahoo.com> wrote:
> Greetings,
>
> I'm actually trying to display two images in two different axes in the GU=
I. Two push button were created to display image1 and image2 to axes1 and a=
xes2 respectively. The problem is, I could not set the displayed image on t=
he axes I intended to. The image will only be displayed on the current acti=
ve axis, meaning that the image will be displayed only on one axis that is =
active. If I click on the second axis, the image will be displayed on the s=
econd axis replacing each other (image) according to the push button I clic=
ked. Maybe the problem is because I do not know on how to set the axes1 and=
axes2 to respective image I want to display.
>
> My current code is as shown below:
>
> %pushbutton1 callback
> function pushbutton1_Callback(hObject, eventdata, handles)
> pic1=3Dimread ('image1.png');
> image (pic1);
> axis off;
> guidata(hObject,handles)
>
> %pushbutton2 callback
> function pushbutton2_Callback(hObject, eventdata, handles)
> pic2=3Dimread ('image2.png');
> image (pic2);
> axis off;
> guidata(hObject,handles)
>
> --------------------------------------------------------------------
> My current GUI only consist of two axes, two push button and a static tex=
t. The tags are axes1, axes2, pushbutton1, pushbutton2 and text1 respective=
ly.
>
> Thanks in advance.
-------------------------------------------------------------
Before you call image(), set the active axes with a line like this:
axes(handles.axes1);
image(pic1);
or
axes(handles.axes2);
image(pic2);
|
|
2
|
|
|
|
Reply
|
ImageAnalyst
|
2/3/2011 2:58:08 PM
|
|
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <878ce1d8-7197-43d7-8b30-26efb80cb7ee@r16g2000yqk.googlegroups.com>...
> On Feb 3, 9:08 am, "Mohd Hanif" <hanif_za...@yahoo.com> wrote:
> > Greetings,
> >
> > I'm actually trying to display two images in two different axes in the GUI. Two push button were created to display image1 and image2 to axes1 and axes2 respectively. The problem is, I could not set the displayed image on the axes I intended to. The image will only be displayed on the current active axis, meaning that the image will be displayed only on one axis that is active. If I click on the second axis, the image will be displayed on the second axis replacing each other (image) according to the push button I clicked. Maybe the problem is because I do not know on how to set the axes1 and axes2 to respective image I want to display.
> >
> > My current code is as shown below:
> >
> > %pushbutton1 callback
> > function pushbutton1_Callback(hObject, eventdata, handles)
> > pic1=imread ('image1.png');
> > image (pic1);
> > axis off;
> > guidata(hObject,handles)
> >
> > %pushbutton2 callback
> > function pushbutton2_Callback(hObject, eventdata, handles)
> > pic2=imread ('image2.png');
> > image (pic2);
> > axis off;
> > guidata(hObject,handles)
> >
> > --------------------------------------------------------------------
> > My current GUI only consist of two axes, two push button and a static text. The tags are axes1, axes2, pushbutton1, pushbutton2 and text1 respectively.
> >
> > Thanks in advance.
>
> -------------------------------------------------------------
> Before you call image(), set the active axes with a line like this:
> axes(handles.axes1);
> image(pic1);
> or
> axes(handles.axes2);
> image(pic2);
Thanks, really much appreciated.
|
|
5
|
|
|
|
Reply
|
Mohd
|
2/5/2011 3:08:03 AM
|
|
|
2 Replies
2612 Views
(page loaded in 0.042 seconds)
|