DSPRelated.com
Forums

image on toolbar button

Started by Sindhu John May 17, 2006
Hi,
I am a little confused about truecolor in CData property. I just need to
have an icon on a uipushtool control. Can anybody tell me how to go
about it? I tried reading a .ico file using imread and assigning
the resulting matrix to the CData property of toolbar pushtool.But it gave
me an error saying that its not truecolor.

Any quick pointers would be highly appreciated.

Thanks,
Sindy
Hi,

try this :

fname=???.ico
[X,map,alpha]=imread(fname);
X=ind2rgb(X,map);
set(buttonhandle,'cdata',X)

read also this :

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/chimage8.html

Je