it would do all the work ( file loading and draw )
but the output to screen would be only the last found picture…
yes, after draw is finished the screen is shown.
your program structure should start with
-a- a keyboard input detect what sets a nEXT variable
-b- a function ( outside of draw ) what
if nEXT is set search and load a new picture ( but not show )
-c- the draw should only do the show
image(img, 0, 0, 280, 280);
what can only work if in setup already called that picture search function once
and the first “img” is loaded already.