Shaded Background i gui

3 次查看(过去 30 天)
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