MATLAB GUI - Set transparent background color for components
조회 수: 67 (최근 30일)
이전 댓글 표시
When I'm adding a MATLAB GUI component (e.g., text, button group, etc.), the default background is gray, which makes it look dissonant. How do I set them transparent?
댓글 수: 0
답변 (3개)
Matt Fig
2011년 5월 21일
For example....
F = figure;
B = uicontrol('style','text','string','hello');
pause(.75) % Pause to see the change....
set(B,'backgroundcolor',get(F,'color'))
댓글 수: 6
Matt Fig
2011년 5월 21일
Actually, you can do similar with an image... look for example at GUI_40 here:
http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
shalu vijay
2019년 2월 25일
The GUI_40 is working only for push buttons. It is not making other objects like text and check boxes transparent.
Daniel Shub
2011년 5월 21일
You cannot easily have the uicontrols (i.e., gui components) be transparent. You can force it with java:
but probably not directly from guide wth mouse clicks.
You can set it to the figure background color like Matt suggests.
This can be done in guide by right clicking the object, selecting object properties, and then setting the background color property.
댓글 수: 0
Robert Cumming
2014년 12월 12일
I know this is an old post - but if anyone comes across this you may be interested in this blog on undocumentedmatlab
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!