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.
"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]);
Subject: Re: set background of uicontrol text box to be transparent?
"Pekka " <pekka.nospam.kumpulainen@tut.please.fi> wrote in
message <g097av$7vc$1@fred.mathworks.com>...
> "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]);
>
Hello Pekka
Yes, I am very much interested to use uicontrol text box,
as it provide me flexibility to pick and place using guide.
The text() function, though solves my purpose but doesnt
give me that flexibilty to pick and place.
Regards
Vihang
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.