App Designer Image Properties

2 visualizaciones (últimos 30 días)
Trevor
Trevor el 5 de Jul. de 2023
Comentada: Trevor el 6 de Jul. de 2023
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!

Respuesta aceptada

Kevin Holly
Kevin Holly el 5 de Jul. de 2023
You can use findall to get a handle of all the uiimages.
handle = findall(app.UIFigure,'Type','uiimage');
for ii = 1:length(handle)
handle(ii).Visible = "off";
end

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by