GUI

18 views (last 30 days)
Murali Mohan
Murali Mohan on 7 Jul 2011
I woluld like to plot a image on any push button or toggle button
can you pls guide me.

Accepted Answer

Gerd
Gerd on 7 Jul 2011
Hi murali,
open GUIDE.
Place a button on the gui.
Go to the callback function
logo = imread('Logo.jpg','jpg');
image(logo);
Gerd
  8 Comments
Murali Mohan
Murali Mohan on 7 Jul 2011
Hi Gerd,Paulo
thanks for the answer.:)
Apart from that I have added
[X map] = imread('up_button.gif');
iconU = ind2rgb(X,map);
set(handles.pushbutton,'CData',iconU);
Paulo Silva
Paulo Silva on 7 Jul 2011
Murali Mohan you accepted the wrong answer but thanks for posting the solution you chosen.

Sign in to comment.

More Answers (2)

Jan
Jan on 7 Jul 2011
Another approach:
pic = fullfile(tempdir, 'picture.png');
uicontrol('Style', 'pushbutton', ...
'String', '
<<file-----pic--.>>
');
  1 Comment
Murali Mohan
Murali Mohan on 7 Jul 2011
Thanks Jan :)

Sign in to comment.


Paulo Silva
Paulo Silva on 7 Jul 2011

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!