Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Displaying images on GUI

Subject: Displaying images on GUI

From: Mamata Kukreja

Date: 2 Feb, 2008 06:12:03

Message: 1 of 10


I have to read images from a folder and display them on the
GUI .. If there are fewer images it is fine to display all
on one page ..
but if the number exceeds to 50 or more .. how can they be
displayed .. is there a scroll bar provision .. any other
idea ..

Subject: Displaying images on GUI

From: Mamata Kukreja

Date: 2 Feb, 2008 07:20:03

Message: 2 of 10

"Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in message
<fo11jj$652$1@fred.mathworks.com>...
>
> I have to read images from a folder and display them on the
> GUI .. If there are fewer images it is fine to display all
> on one page ..
> but if the number exceeds to 50 or more .. how can they be
> displayed .. is there a scroll bar provision .. any other
> idea ..

????

Subject: Displaying images on GUI

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 2 Feb, 2008 07:52:41

Message: 3 of 10

In article <fo15j3$i0v$1@fred.mathworks.com>,
Mamata Kukreja <mamata_kukreja@yahoo.com> wrote:
>"Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in message
><fo11jj$652$1@fred.mathworks.com>...

>> I have to read images from a folder and display them on the
>> GUI .. If there are fewer images it is fine to display all
>> on one page ..
>> but if the number exceeds to 50 or more .. how can they be
>> displayed .. is there a scroll bar provision .. any other
>> idea ..

>????

You only waited 1 hour and 8 minutes before posting your ???? followup,
and your original posting was at 20 after midnight Central time
(i.e., the middle of North America) -- so after one in the morning
in eastern North America where more than half the population is.

Pretty much the same question has been answered in the past, and
the solution could have been found with a search engine request
to look for information about matlab gui scrollbar .

To recap:

Create a uipanel() on your figure, the size of the viewing area.
Create a second uipanel() whose Parent is the first uipanel,
and which is big enough to contain all of the data. Draw your
images, making sure that their Parent is the second uipanel.
Now configure the Callback on your scrollbar so that it changes
the Position of the second uipanel. The edges of the first
uipanel will "clip" the visibility of the second uipanel so that
only the portion of the second uipanel that is behind the
"window" that is the size of the first uipanel will be visible.
--
   "Any sufficiently advanced bug is indistinguishable from a feature."
   -- Rich Kulawiec

Subject: Displaying images on GUI

From: Vihang Patil

Date: 2 Feb, 2008 07:55:06

Message: 4 of 10

"Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in
message <fo11jj$652$1@fred.mathworks.com>...
>
> I have to read images from a folder and display them on
the
> GUI .. If there are fewer images it is fine to display
all
> on one page ..
> but if the number exceeds to 50 or more .. how can they
be
> displayed .. is there a scroll bar provision .. any
other
> idea ..


doc imscrollpanel
HTH
Vihang

Subject: Displaying images on GUI

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 2 Feb, 2008 17:22:35

Message: 5 of 10

In article <fo17kq$9ru$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:
>"Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in
>message <fo11jj$652$1@fred.mathworks.com>...
>>
>> I have to read images from a folder and display them on
>the
>> GUI .. If there are fewer images it is fine to display
>all
>> on one page ..
>> but if the number exceeds to 50 or more .. how can they
>be
>> displayed .. is there a scroll bar provision .. any
>other
>> idea ..

>doc imscrollpanel

imscrollpanel is only for a single image, not for displaying
multiple images.
--
   "Beware of bugs in the above code; I have only proved it correct,
   not tried it." -- Donald Knuth

Subject: Displaying images on GUI

From: Vihang Patil

Date: 3 Feb, 2008 08:23:03

Message: 6 of 10

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>
> imscrollpanel is only for a single image, not for displaying
> multiple images.

Dear Walter
Well, imscrollpanel with montage can be used to achieve the
OP's requirement
Try the following code

str = 'C:\Documents and Settings\All Users\Documents\My
Pictures\Sample Pictures'; %change this to reflect your
desired picture directory
result = dir(fullfile(str,'/*.jpg'));
for i = 1 : length(result)
    img(:,:,:,i) = imread([str '\' result(i,1).name]);
end
hFig = figure('Toolbar','none',...
              'Menubar','none');
hIm = montage(img);
hSP = imscrollpanel(hFig,hIm);
set(hSP,'Units','normalized',...
        'Position',[0 .1 1 .9]);

Regards
Vihang

Subject: Displaying images on GUI

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 3 Feb, 2008 16:45:54

Message: 7 of 10

In article <fo3tl7$fqm$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:
>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in

>> imscrollpanel is only for a single image, not for displaying
>> multiple images.

>Well, imscrollpanel with montage can be used to achieve the
>OP's requirement
>Try the following code

>for i = 1 : length(result)
> img(:,:,:,i) = imread([str '\' result(i,1).name]);
>end

You assume there that each image is exactly the same size.

You also assume that all of them are the same type, either
truecolor (3D) or indexed (2D).

--
   "No one has the right to destroy another person's belief by
   demanding empirical evidence." -- Ann Landers

Subject: Displaying images on GUI

From: Mamata Kukreja

Date: 4 Feb, 2008 14:28:01

Message: 8 of 10

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fo4r42$3e9$1@canopus.cc.umanitoba.ca>...
> In article <fo3tl7$fqm$1@fred.mathworks.com>,
> Vihang Patil <vihang_patil@yahoo.com> wrote:
> >roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>
> >> imscrollpanel is only for a single image, not for
displaying
> >> multiple images.
>
> >Well, imscrollpanel with montage can be used to achieve the
> >OP's requirement
> >Try the following code
>
> >for i = 1 : length(result)
> > img(:,:,:,i) = imread([str '\' result(i,1).name]);
> >end
>
> You assume there that each image is exactly the same size.
>
> You also assume that all of them are the same type, either
> truecolor (3D) or indexed (2D).
>
> --
> "No one has the right to destroy another person's belief by
> demanding empirical evidence." -- Ann
Landers



Is uipanel and imscrollpanel supported in version 6.5 ??
I find no help regarding these topics in 6.5 !

Subject: Displaying images on GUI

From: Steven Lord

Date: 4 Feb, 2008 15:50:50

Message: 9 of 10


"Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in message
news:fo77dh$1k1$1@fred.mathworks.com...
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <fo4r42$3e9$1@canopus.cc.umanitoba.ca>...
>> In article <fo3tl7$fqm$1@fred.mathworks.com>,
>> Vihang Patil <vihang_patil@yahoo.com> wrote:
>> >roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>>
>> >> imscrollpanel is only for a single image, not for
> displaying
>> >> multiple images.
>>
>> >Well, imscrollpanel with montage can be used to achieve the
>> >OP's requirement
>> >Try the following code
>>
>> >for i = 1 : length(result)
>> > img(:,:,:,i) = imread([str '\' result(i,1).name]);
>> >end
>>
>> You assume there that each image is exactly the same size.
>>
>> You also assume that all of them are the same type, either
>> truecolor (3D) or indexed (2D).
>>
>> --
>> "No one has the right to destroy another person's belief by
>> demanding empirical evidence." -- Ann
> Landers
>
>
>
> Is uipanel and imscrollpanel supported in version 6.5 ??
> I find no help regarding these topics in 6.5 !

UIPANEL was introduced in MATLAB 7.0 (R14):

http://www.mathworks.com/access/helpdesk/help/techdoc/rn/f6-998197.html

I believe IMSCROLLPANEL was introduced in Image Processing Toolbox 5.0
(R14), which was released with MATLAB 7.0 (R14):

http://www.mathworks.com/access/helpdesk/help/toolbox/images/rn/bqnw2fy-1.html

--
Steve Lord
slord@mathworks.com

Subject: Displaying images on GUI

From: Mamata Kukreja

Date: 4 Feb, 2008 17:17:03

Message: 10 of 10

"Steven Lord" <slord@mathworks.com> wrote in message
<fo7c8q$fda$1@fred.mathworks.com>...
>
> "Mamata Kukreja" <mamata_kukreja@yahoo.com> wrote in message
> news:fo77dh$1k1$1@fred.mathworks.com...
> > roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> > message <fo4r42$3e9$1@canopus.cc.umanitoba.ca>...
> >> In article <fo3tl7$fqm$1@fred.mathworks.com>,
> >> Vihang Patil <vihang_patil@yahoo.com> wrote:
> >> >roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> >>
> >> >> imscrollpanel is only for a single image, not for
> > displaying
> >> >> multiple images.
> >>
> >> >Well, imscrollpanel with montage can be used to
achieve the
> >> >OP's requirement
> >> >Try the following code
> >>
> >> >for i = 1 : length(result)
> >> > img(:,:,:,i) = imread([str '\' result(i,1).name]);
> >> >end
> >>
> >> You assume there that each image is exactly the same size.
> >>
> >> You also assume that all of them are the same type, either
> >> truecolor (3D) or indexed (2D).
> >>
> >> --
> >> "No one has the right to destroy another person's
belief by
> >> demanding empirical evidence." -- Ann
> > Landers
> >
> >
> >
> > Is uipanel and imscrollpanel supported in version 6.5 ??
> > I find no help regarding these topics in 6.5 !
>
> UIPANEL was introduced in MATLAB 7.0 (R14):
>
>
http://www.mathworks.com/access/helpdesk/help/techdoc/rn/f6-998197.html
>
> I believe IMSCROLLPANEL was introduced in Image Processing
Toolbox 5.0
> (R14), which was released with MATLAB 7.0 (R14):
>
>
http://www.mathworks.com/access/helpdesk/help/toolbox/images/rn/bqnw2fy-1.html
>
> --
> Steve Lord
> slord@mathworks.com
>
>


so hav 2 shift to 7.0 :(
no way of doin it in 6.5 .. ani wy of updatin d version
directli or hav 2 buy a cd ..
else can i develop the interface in VB n integrate VB and
MATLAB ..

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us