>如果要为整个图形设置纯色背景颜色,则执行此操作需要
a documented way,例如:
% When creating a new uifigure:
fig = uifigure('Color',[R G B])
% if the uifigure already exists:
fig.Color = [R G B];
>如果你想改变一些地区的背景颜色,你可以添加一个没有标题或边框的uipanel(uipanel(…,’BorderType’,’none’,’Title’,”,’BackgroundColor’, [RGB])).
>如果要将图像设置为整个图形的背景:
function q41602238a
%% Turn off some warnings:
warning off Matlab:structOnObject
warning off Matlab:HandleGraphics:ObsoletedProperty:JavaFrame
%% 0. Create a uifigure:
app = uifigure();
%% 1. Get a handle to the webwindow:
while true
try
win = struct(struct(app).Controller).Container.CEF;
break
catch
pause(0.1); % Give the figure (webpage) some more time to load
end
end
%% 2. Find the data_tag of the DOM element w