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

조회 수: 6 (최근 30일)
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

채택된 답변

Atacan Tosun
Atacan Tosun 2016년 12월 16일
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);

추가 답변 (2개)

Image Analyst
Image Analyst 2016년 12월 11일
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
Image Analyst
Image Analyst 2016년 12월 11일
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.

댓글을 달려면 로그인하십시오.


Atacan Tosun
Atacan Tosun 2016년 12월 16일
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
Image Analyst
Image Analyst 2016년 12월 17일
편집: Image Analyst 2016년 12월 17일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by