No matter what I do in App Designer, the image doesn't update.

7 vues (au cours des 30 derniers jours)
채호 박
채호 박 le 9 Déc 2022
Commenté : chrisw23 le 9 Déc 2022
As shown in the figure, No. 101 (purple arrow) is in the opposite direction to No. 102. At this time, 101.jpg, which was newly saved after correcting the direction (rightmost picture), has an arrow pointing upward. However, whether I turn my computer off and on, create a new folder, or delete all my photos and move them back, the arrow always points in the downward direction before editing. What could be the problem?
function BtnOpen1ButtonPushed(app, event)
[app.filename1, user_canceled] = imgetfile('InitialPath', app.ROOT_PATH );
if user_canceled == true, return; end
[app.ROOT_PATH, name, ext] = fileparts(app.filename1);
app.Fn1.Value = app.filename1;
app.img1 = imread( app.filename1 );
image(app.UIAxes1, app.img1)
axis(app.UIAxes1, 'tight')
app.UIAxes1.Title.String = name;
nLen = length(name);
fmtspec = sprintf('%%0%dd', nLen);
name2 = sprintf(fmtspec, str2double(name) + 1 );
app.filename2 = fullfile( app.ROOT_PATH, strcat(name2, ext) );
app.img2 = imread( app.filename2 );
image(app.UIAxes2, app.img2)
axis(app.UIAxes2, 'tight')
app.UIAxes2.Title.String = name2;
end
The result window will display two arrows pointing upwards, respectively. (Like 101.jpg)
  1 commentaire
chrisw23
chrisw23 le 9 Déc 2022
save your last setting on close event and load the last setting at startup

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by