How can I get rid of these problems fullscreen, browser from a file and efficiency

6 views (last 30 days)
Hi;
I am designing slideshow interface with guide. But I have some problems ;
  • 1) How to make fullscreen guide ( I've tried Yair's metod and it did not work ) and ( set(gcf, 'units','norm','Outerposition',[0 0 1 1]) as well.
  • 2) For the slideshow, I have to select a file which contains images. But I can open just specific file that I declared (***** myFolder = 'C:\Users\Atacan\2015-09-27'; ****** line 122). I need to access other files. I could not find way to do this.
  • 3) When I run this code can not detect my commands(bush and toggle buttons) immediately. Is there any advice to make it more efficient or better way to this.( I have i7 processor and 16 gb ram)
If you find any problem please let me know.
Notes about the code;
If there is no image or end of the slideshow screen is become black. Black.jpg for this reason.
If the show end, time will be 0:0:0.
Fullscreen problem

Accepted Answer

Atacan Tosun
Atacan Tosun on 16 Dec 2016
Answer of 2nd question
myFolder = PathName;
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
imageArray = imread(fullFileName);
imshow(imageArray);

More Answers (2)

Image Analyst
Image Analyst on 11 Dec 2016
1. I use Yair's maximize figure function, attached, and it works well. What operating system are you using?
2. Use this code to let the user browse and select a file:
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = 'C:\Program Files\MATLAB';
if ~exist(startingFolder, 'dir')
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
3. I don't know exactly what "detect my commands" means. Do you mean that the GUI is not repainted/refreshed/updated immediately? If so, issue the "drawnow" command to force it to update immediately. Otherwise, maybe step through with the debugger. Or else explain what "detect my commands" means.
  6 Comments
Image Analyst
Image Analyst on 11 Dec 2016
OK, but you're just reading a bunch of images from disk and repeatedly overwriting a variable imageArray. You don't even display it or analyze it or anything. What's the point of that? The variable imageArray will contain only the very last file you read.

Sign in to comment.


Atacan Tosun
Atacan Tosun on 16 Dec 2016
Answer of 1st question
function varargout = Guide1_1_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
set(gcf, 'units','normalized','position',[0 0 1 1]);
Under the output Function
  1 Comment
Image Analyst
Image Analyst on 17 Dec 2016
Edited: Image Analyst on 17 Dec 2016
I don't know why Yair's method (attached) is not working for you. It should. Can you say why? It works for me and most everyone else.
Your method makes the GUI as large as the screen, but it's not truly maximized, and I often find it's not so well aligned on the screen.

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!