6

How can i display a scrollable grid of images in matlab GUI?

I want something similar to what is shown below

enter image description here

This stackoverflow post describes a way of displaying images in a uitable by setting the 'String' property to an HTML code pointing to an image. But this requires me to save the images to disk which is not an option i would like as these displays are fired up dynamically.

It would also be nice, if i could add a checkbox inside each image so the user can select a subset of them.

Community
  • 1
  • 1
cdeepakroy
  • 2,203
  • 3
  • 19
  • 23
  • 1
    This is going to be hard to do in matlab. Are you able to use .net or java? – PeterM Aug 28 '13 at 23:08
  • No. I am not allowed to. If you are suggesting, calling java code from matlab (to use some undocumented gui functionality), then yes that would work. But, I guess matlab's gui functionality is way too primitive for such things. – cdeepakroy Aug 28 '13 at 23:48
  • Note that you can also save the images to web, if it helps you. – Adiel Aug 29 '13 at 05:51

2 Answers2

4

You can use this tool. In the gui, you should be able to scroll through. But to have title below every image you might have to edit the tool.

Sample output: a grid of images http://www.mathworks.in/matlabcentral/fx_files/22387/12/imdisp.jpg

Prashanth
  • 1,252
  • 2
  • 13
  • 28
  • it is not scrollable - images are displayed on different pages. – marsei Aug 29 '13 at 08:36
  • I think we can add a scroll bar using uicontrol() – Prashanth Aug 29 '13 at 12:32
  • 2
    [This](http://www.mathworks.com/matlabcentral/fileexchange/5253-scrolling-figure-demo) demo shows how to enable scroll in a figure. – Prashanth Aug 29 '13 at 12:55
  • @prasanth. I found both the [original](http://www.mathworks.in/matlabcentral/fileexchange/22387-imdisp) version mentioned by you and the [enhanced](http://www.mathworks.in/matlabcentral/fileexchange/42685) version but i dint know how to scroll through them with a slider bar. Seems like, now, i have a solution in pieces. Will try to get them to work together and post my solution. – cdeepakroy Aug 29 '13 at 14:51
1

The answer is here:

How can I use scrollbars in MATLAB figure windows when viewing large GUIs?

-> Note: This is a workaround, scrollbars are not available for Matlab-figures

I would suggest to use the tool Prashanth presented in his awnswer and combine it, by putting all elements within the panel.

Lucius II.
  • 1,832
  • 12
  • 19