Shaded Background i gui

4 views (last 30 days)
Douglas Anderson
Douglas Anderson on 17 Jan 2017
Commented: Douglas Anderson on 18 Jan 2017
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

Accepted Answer

Jan
Jan on 17 Jan 2017
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 Comment
Douglas Anderson
Douglas Anderson on 18 Jan 2017
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!