Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!i18g2000pro.googlegroups.com!not-for-mail
From: damayi <damayi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: How to set 'white' color to be transparent to its background?
Date: Mon, 10 Aug 2009 23:47:26 -0700 (PDT)
Organization: http://groups.google.com
Lines: 16
Message-ID: <810c8c34-1fdd-41bc-baec-e58592e987b7@i18g2000pro.googlegroups.com>
NNTP-Posting-Host: 211.160.21.36
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1249973247 20872 127.0.0.1 (11 Aug 2009 06:47:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 11 Aug 2009 06:47:27 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: i18g2000pro.googlegroups.com; posting-host=211.160.21.36; 
	posting-account=BfRwPAkAAAA6EcWmHJDYuRO-FFj7x56H
User-Agent: G2/1.0
X-HTTP-Via: 1.1 ISA02, 1.1 ISA03
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) 
	AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:562303


Dear all
These days, I use GUIDE to create a toolbar in a GUI application. Each
tool in this toolbar was set to an icon picture. An difficult problem
was encountered, that is: there are many white color space in the
icon, so it looks not very beautiful. I want to set 'white' icon as a
transparent color to the toolbar background , how to get that? Below
is my code, I hope you can help me to resolve this problem.

[I1, Map] = imread(utt_Icon);  % utt_icon is 'png' format picture
file.
set(hObject, 'CData', ind2rgb(I1, Map));


Best Regards
mayi
2009-8-11