Shaded Background i gui

조회 수: 3 (최근 30일)
Douglas Anderson
Douglas Anderson 2017년 1월 17일
댓글: Douglas Anderson 2017년 1월 18일
Hello,
Is there any (fairly simple) way to make a gradient background in a gui, just to make it look better? Something like is done in Shape Fill in Microsoft Word.
Thanks!
Doug

채택된 답변

Jan
Jan 2017년 1월 17일
You can start with creating a full-figure axes in the background:
FigH = figure;
AxesH = axes( ...
'Parent', FigH, ...
'Units', 'normalized', ...
'Position', [0, 0, 1, 1], ...
'Visible', 'off', ...
'XLimMode', 'manual', 'XLim', [0, 1], ...
'YLimMode', 'manual', 'YLim', [0, 1], ...
'XTick', [], 'YTick', [], ...
'NextPlot', 'add', ...
'HitTest', 'off');
Now you can insert an image or e.g. a patch:
x = [0, 1, 1, 0];
y = [0, 0, 1, 1];
c = rand(1, 4);
patch(x, y, c, 'Parent', AxesH);
  댓글 수: 1
Douglas Anderson
Douglas Anderson 2017년 1월 18일
Very nice. Perhaps you can shed some other light on a similar issue.
In a GUIDE gui, if you change the color of a button, the shading that makes it look like a button (lighter on the top than on the bottom) goes away. Any suggestion on how to do that for all buttons, without having to do this for each and every one?
Thanks, Jan.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by