Path: news.mathworks.com!not-for-mail
From: "Pekka " <pekka.nospam.kumpulainen@tut.please.fi>
Newsgroups: comp.soft-sys.matlab
Subject: Re: set background of uicontrol text box to be transparent?
Date: Mon, 12 May 2008 10:49:03 +0000 (UTC)
Organization: Tampere University of Technology
Lines: 37
Message-ID: <g097av$7vc$1@fred.mathworks.com>
References: <g06ah2$9dh$1@fred.mathworks.com>
Reply-To: "Pekka " <pekka.nospam.kumpulainen@tut.please.fi>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210589343 8172 172.30.248.38 (12 May 2008 10:49:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 12 May 2008 10:49:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 218565
Xref: news.mathworks.com comp.soft-sys.matlab:467874


"Vihang Patil" <vihang_patil@yahoo.com> wrote in message 
<g06ah2$9dh$1@fred.mathworks.com>...
> Hello
> Is there any way to turn the background of the text box 
> uicontrol to be transparent?
> ex: I have a figure window which has an image displayed 
on 
> it. I just want the text part of the uicontrol to be 
> displayed and want the rest of the part to be transparent 
> so that I can see the image displayed in the figure 
window 
> beneath it.
> 
> I have tried this but this doesnt help;
> 
> load trees
> h1 = figure,
> h2 = imshow(X,map);
> h=uicontrol('style','text','string','hello');
> set(h,'position',[100 150 50 20]);
> parentColor = get(get(h, 'parent'), 'color');
> set(h,'foregroundcolor', [0 0 0], ...
> 'backgroundcolor', parentColor);
> 
> The above will set the background of the text control to 
> that of the figure window and not the one of the trees.
> Any help?
> Vihang


Do you have to use uicontrol? 
It doesn't accept BackgroundColor 'none', which is
the default of text objects.
h=text('string','hello','position',[140 150]);