App Designer Image Properties
2 次查看(过去 30 天)
显示 更早的评论
Is there a way to hide all or several images at the same time?
I am writing code to hide/show certain images of a map based on user selection. Is there a more efficient way to do this? My current solution is writing several separate app.mapname.visible = 'off' lines for each image. There will be likely 100s of images used.
% Value changed function: ChooseBayDropDown
function ChooseBayDropDownValueChanged(app, event)
value = app.ChooseBayDropDown.Value;
switch value
case 'Bay 1 - Receiving'
app.bay1_map.Visible = 'on';
app.blank_map.Visible = 'off';
app.bay2_map.Visible = 'off';
app.bay3_map.Visible = 'off';
app.bay4_map.Visible = 'off';
case 'Bay 2 - Heat Room'
app.bay2_map.Visible = 'on';
app.blank_map.Visible = 'off';
app.bay1_map.Visible = 'off';
app.bay3_map.Visible = 'off';
app.bay4_map.Visible = 'off';
case 'Bay 3 - A-Plant'
app.bay3_map.Visible = 'on';
app.blank_map.Visible = 'off';
app.bay2_map.Visible = 'off';
app.bay3_map.Visible = 'off';
app.bay4_map.Visible = 'off';
case 'Bay 4 - Hot Cast'
app.bay4_map.Visible = 'on';
app.blank_map.Visible = 'off';
app.bay1_map.Visible = 'off';
app.bay2_map.Visible = 'off';
app.bay3_map.Visible = 'off';
end
Thanks!
0 个评论
采纳的回答
Kevin Holly
2023-7-5
handle = findall(app.UIFigure,'Type','uiimage');
for ii = 1:length(handle)
handle(ii).Visible = "off";
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!