GUI

2 次查看(过去 30 天)
Murali Mohan
Murali Mohan 2011-7-7
I woluld like to plot a image on any push button or toggle button
can you pls guide me.

采纳的回答

Gerd
Gerd 2011-7-7
Hi murali,
open GUIDE.
Place a button on the gui.
Go to the callback function
logo = imread('Logo.jpg','jpg');
image(logo);
Gerd
  8 个评论
Murali Mohan
Murali Mohan 2011-7-7
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 2011-7-7
Murali Mohan you accepted the wrong answer but thanks for posting the solution you chosen.

请先登录,再进行评论。

更多回答(2 个)

Jan
Jan 2011-7-7
Another approach:
pic = fullfile(tempdir, 'picture.png');
uicontrol('Style', 'pushbutton', ...
'String', '
<<file-----pic--.>>
');

Paulo Silva
Paulo Silva 2011-7-7

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by