how ot code gui scrollbar ?

3 次查看(过去 30 天)
romasha
romasha 2014-2-16
i have a gui in which i m showing some images but there are alot of images in figure so i want to use scrollbar..how can i code this??

回答(2 个)

Anand
Anand 2014-2-16
Use the uicontrol function with 'slider' as the first input. Look at the link above for details.
  2 个评论
Image Analyst
Image Analyst 2014-2-17
编辑:Image Analyst 2014-2-17
The word uicontrol is in blue, and the cursor turns into a hand when over it, which means it's a link.

请先登录,再进行评论。


Image Analyst
Image Analyst 2014-2-16
I'd use the scrollbar built in to a listbox. A listbox is so much more user friendly than a scroll bar because you can see the name and pick the image directly from the list. You can load a listbox like this:
%=====================================================================
% Load up the listbox with image files in folder handles.ImageFolder
function handles=LoadImageList(handles)
ListOfImageNames = {};
folder = handles.ImageFolder;
if ~isempty(handles.ImageFolder)
if exist(folder,'dir') == false
msgboxw(['Folder ' folder ' does not exist.']);
return;
end
else
msgboxw('No folder specified as input for function LoadImageList.');
return;
end
% If it gets to here, the folder is good.
ImageFiles = dir([handles.ImageFolder '/*.*']);
for Index = 1:length(ImageFiles)
baseFileName = ImageFiles(Index).name;
[folder, name, extension] = fileparts(baseFileName);
extension = upper(extension);
switch lower(extension)
case {'.png', '.bmp', '.jpg', '.tif', '.avi'}
% Allow only PNG, TIF, JPG, or BMP images
ListOfImageNames = [ListOfImageNames baseFileName];
otherwise
end
end
set(handles.lstImageList,'string',ListOfImageNames);
return
  1 个评论
romasha
romasha 2014-2-17
this is not what i required kindly give me the slider code

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by