Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Picture in GUI

Subject: Picture in GUI

From: Chris McCorquodale

Date: 21 Sep, 2011 11:18:10

Message: 1 of 9

Hi,

Can anyone tell me if there is a way to programme a picture into a GUI (eg a company logo in the corner, etc)?

Thanks

Subject: Picture in GUI

From: Abbas Cheddad

Date: 21 Sep, 2011 11:41:10

Message: 2 of 9

Chris,

Go to your GUI and place an axes object, it should have a name like "axes1":

Then go to your .m file and place this code right after:

function FunctionName_OpeningFcn(hObject, eventdata, handles, varargin)

axes(handles.axes1); % make canvas active
    Logo=imread('About.png');
    imshow(Logo);
guidata(handles.axes1, handles);


Hope that helps.
Abbas




"Chris McCorquodale" wrote in message <j5ch5i$35c$1@newscl01ah.mathworks.com>...
> Hi,
>
> Can anyone tell me if there is a way to programme a picture into a GUI (eg a company logo in the corner, etc)?
>
> Thanks

Subject: Picture in GUI

From: Chris McCorquodale

Date: 21 Sep, 2011 13:34:27

Message: 3 of 9

"Abbas Cheddad" <cheddad10NOSPAM@yahoo.com> wrote in message <j5cigm$824$1@newscl01ah.mathworks.com>...
> Chris,
>
> Go to your GUI and place an axes object, it should have a name like "axes1":
>
> Then go to your .m file and place this code right after:
>
> function FunctionName_OpeningFcn(hObject, eventdata, handles, varargin)
>
> axes(handles.axes1); % make canvas active
> Logo=imread('About.png');
> imshow(Logo);
> guidata(handles.axes1, handles);
>
>
> Hope that helps.
> Abbas

Hi Abbas,

Thanks for the reply. This worked when i changed 'imshow' to 'image'. Only problem now is that I have tick marks and numbered axes which I cant get rid of. I have been playing about in the axes properties section for a while. Do you know how to do it?

Subject: Picture in GUI

From: Steven_Lord

Date: 21 Sep, 2011 13:45:42

Message: 4 of 9



"Chris McCorquodale" <c.mccorquodale@axon-cable.co.uk> wrote in message
news:j5cp53$4p8$1@newscl01ah.mathworks.com...
> "Abbas Cheddad" <cheddad10NOSPAM@yahoo.com> wrote in message
> <j5cigm$824$1@newscl01ah.mathworks.com>...

*snip*

> Thanks for the reply. This worked when i changed 'imshow' to 'image'. Only
> problem now is that I have tick marks and numbered axes which I cant get
> rid of. I have been playing about in the axes properties section for a
> while. Do you know how to do it?

axis off

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Picture in GUI

From: Abbas Cheddad

Date: 21 Sep, 2011 13:51:28

Message: 5 of 9

In the axes properties turn the visibility off.

Subject: Picture in GUI

From: Chris McCorquodale

Date: 21 Sep, 2011 14:35:29

Message: 6 of 9

"Steven_Lord" <slord@mathworks.com> wrote in message <j5cpq5$7t2$1@newscl01ah.mathworks.com>...
>
>
> "Chris McCorquodale" <c.mccorquodale@axon-cable.co.uk> wrote in message
> news:j5cp53$4p8$1@newscl01ah.mathworks.com...
> > "Abbas Cheddad" <cheddad10NOSPAM@yahoo.com> wrote in message
> > <j5cigm$824$1@newscl01ah.mathworks.com>...
>
> *snip*
>
> > Thanks for the reply. This worked when i changed 'imshow' to 'image'. Only
> > problem now is that I have tick marks and numbered axes which I cant get
> > rid of. I have been playing about in the axes properties section for a
> > while. Do you know how to do it?
>
> axis off
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thats the first thing i tried. I may be looking in the wrong place though.

If i double click the set of axes, I get the property inspector. Then under 'Visible' I click off....but it is still visible for some reason?

Am I doing the wrong thing here?

Subject: Picture in GUI

From: ImageAnalyst

Date: 21 Sep, 2011 14:44:39

Message: 7 of 9

On Sep 21, 10:35 am, "Chris McCorquodale" <c.mccorquod...@axon-
cable.co.uk> wrote:
> Thats the first thing i tried. I may be looking in the wrong place though.
>
> If i double click the set of axes, I get the property inspector. Then under 'Visible' I click off....but it is still visible for some reason?
>
> Am I doing the wrong thing here?
-------------------------------------------------------------------------
Chris :
Don't worry about what's happening in GUIDE. When you're actually
running the program and issue the command axis off it should turn off
the tick marks and numbers (if they were even on in the first place).
ImageAnalyst

Subject: Picture in GUI

From: Chris McCorquodale

Date: 21 Sep, 2011 14:56:29

Message: 8 of 9

Ahhh...I understand now and have sorted it.
Thanks for your help everyone.

Subject: Picture in GUI

From: Abbas Cheddad

Date: 21 Sep, 2011 14:59:29

Message: 9 of 9

Ok, then try like the guys here suggest (it will work for you):



function FunctionName_OpeningFcn(hObject, eventdata, handles, varargin)

axes(handles.axes1); % make canvas active
    Logo=imread('About.png'); %Your log image
    image(Logo);
guidata(handles.axes1, handles);
axis off;

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us