Shaded Background i gui

2 ビュー (過去 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 Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by