Shaded Background i gui

3 visualizzazioni (ultimi 30 giorni)
Douglas Anderson
Douglas Anderson il 17 Gen 2017
Commentato: Douglas Anderson il 18 Gen 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

Risposta accettata

Jan
Jan il 17 Gen 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 Commento
Douglas Anderson
Douglas Anderson il 18 Gen 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by