i'm creating a gui (using guide) which has a background image.i want the 'static text' box to display only the string ,ie. the background of static text must be transparent.how can it be done?we can't achieve this using the 'property inspector' .
praveen
> also tell me how to make background of 'static text' transparent
Just do not use a UICONTROL('Style', 'text'), but a TEXT object.
I don't know how to do this in GUIDE, because I program my GUIs manually.
Good luck, Jan
What do you mean by using TEXT object?
T.static_text = text('string', '.....' , 'position', [.....]) in stead of
T.static_text = uicontrol('style', 'text','string', '.....' , 'position', [.....])
Best regards
Sermed
"Jan Simon" <matlab.T...@nMINUSsimon.de> wrote in message <hg5vvp$6op$1...@fred.mathworks.com>...
> What do you mean by using TEXT object?
>
> T.static_text = text('string', '.....' , 'position', [.....]) in stead of
> T.static_text = uicontrol('style', 'text','string', '.....' , 'position', [.....])
Yes.
The object created by the TEXT command has a transparent background as default. The TEXT is needs and axes, which can be inserted in GUIDE, but as far as I can see, you have to create the TEXT manually (not through buttons in GUIDE).
Meta-reply: The second time I can answer with "yes" or "no" today. See:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/268531#702749
Thanks, this made my day.
Jan
I've tried to use the TEXT object as shown below:
H.txt_obj = text('string', 'static text test', 'position', [30, 150, 100, 100])
and I got:
??? Error using ==> text
Value must be a 2 or 3 element vector
I have designed the GUI using GUIDE in the begging, but because the transparency static text is important for my work, I've started again designing the same GUI manually.
My question is:
Is it possible to make the static text background invisible and how?
Thanx for you efforts
"Jan Simon" <matlab.T...@nMINUSsimon.de> wrote in message <hgbngc$mo0$1...@fred.mathworks.com>...
If you read the documentation for TEXT, you would see that you called
it wrong.
h = text(x,y,'string')
so, in your case:
H.txt_obj = text(30,150,'static text test')
axis off %*
Note: text is not the same as a static text object
* as Jan mentioned, TEXT places a text object on axes.
-Nathan
I've used the text instead of uicontrol:
text(0.5, 0.5, 'STRING', 'HorizontalAlignment','center','BackgroundColor', 'none');
The color of text background was gray??
What have I done wrong??
Thanks in advance
Sermed
Nathan <ngre...@gmail.com> wrote in message <6b08e8b2-c336-430f...@z35g2000prh.googlegroups.com>...
What makes you think the background of the object is gray?
Try this:
text(0.5, 0.5, 'STRING',
'HorizontalAlignment','center','BackgroundColor', 'none');
axis off %is this the gray you were talking about?
set(gcf,'Color','b')
%the text background (as well as the figure) should be blue.
set(gcf,'Color','w')
%text and figure background should be white
If that's not what you mean by transparent, I'm confused.
-Nathan
h = text(x,y,'string')
well friends....write d above code in
function st_OpeningFcn(hObject, eventdata, handles, varargin)
....
....
here st is d name of my figure...
anyways thankyou very much sir....D code has really helped me.....
have a great day!!!