I want call getPhoto() into the app and getPhoto() is a function into another .m file in same directory.
App code
properties (Access = public)
fullname % Description
ImageFile % Description
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: CaricaimmagineSRButton
function CaricaimmagineSRButtonPushed(app, event)
getPhoto();
test = app.fullname;
answer = questdlg('do you wanna crop?', ...
'Dessert Menu', ...
'Yes', 'No','No');
% Handle response
switch answer
case 'Yes'
app.ImageFile = imcrop(app.ImageFile);
close Figure 1;
case 'No'
end
app.ImageFile = imresize(app.ImageFile, [300 200]);
app.TextArea.Visible = false;
app.UIAxes.Visible = true;
imshow(app.ImageFile, 'Parent', app.UIAxes);
end
getPhoto() code
function getPhoto()
cd('C:\Users\Gianl\Documents\MATLAB\app\test\Images');
[filename,filepath] = uigetfile({'*.*;*.jpg;*.png;*.bmp;*.oct'}, 'Select File to Open');
cd('C:\Users\Gianl\Documents\MATLAB\app');
app = app2;
app.fullname = [filepath,filename];
app.ImageFile = imread(app.fullname);
end
with getPhoto() i want to choose the photo and pass to the app the name and the photo into the properties of the app.