Re: scrolled list of images?



On 1 Mar 2006 16:38:30 -0800, woodenbicycle@xxxxxxxxxxx wrote:

I am trying to write a small graphical utility for managing my photos.
I am at a loss, however, when it comes to displaying an _arbitrary_
number of images.

In my previous program I had a few JPEG images (via Photo and
createImage) that were updated/changed depending on which files were
slected from drop-down menus. This was easy as I made a canvas for each
image area.

Now back to my current problem. I would like to make a scrollable
region with n number of 320x240 JPEG images, one on top of each other,
so the scrollable area is about 320 pixels wide and n x 240 pixels
tall. How would I go about doing this? I can easily make a list/array
of the path/filenames of the images themselves. But how do I go about
actually creating/displaying n number of photo/createimage/canvases?
Right now I only know how to hard code a fixed number of canvases for
the JPEG photos. How do I make this dynamic and flexible so I can
accomplish my goal?

This shows how to put it in an HList. The next step is to "paginate"
the HList, so only x number appear at a time. What if you had 1000
photos? Thats a long scroll bar.
http://perlmonks.org?node_id=327499

To add pagination, see
http://perlmonks.org?node_id=338291
Pagination requires a few tricks, to avoid memory gains.


My biggest advice to you, is watch how you display your images,
and reuse image objects. Don't try to destroy an image and create
a new one everytime you change display....you will start to
gain memory.
What you want to do is create 1 display image, use $image->clear,
then put the new image into it.

Same with the thumbnails..... 1000 images would require 1000 image
objects, which would slow program startup, and cause memory bloat.
What you want is to paginate the thumbnails, so you only create say 10
thumbnail image objects, then when you paginate, you clear them out,
and load a different 10, etc. Your program will be faster and use less
memory.




--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
.



Relevant Pages

  • Re: How to detect lack of memory failure
    ... The JPEG images are all good; I supply them along with the app. ... >> different jpg files and passes them to the image control for display. ...
    (microsoft.public.vb.winapi.graphics)
  • Re: JPEG Images Upside Down - RenderFile
    ... > I am using the RenderFile method of IGraphBuilder to ... > display some JPEG images. ... > Professional with DirectX 9b and everything works fine. ... > same JPEG images are displayed upside down. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: How do you show an image that is larger than the largest screen?
    ... RUN /n mspaint Filename.jpg ... Purchase VFP8 here: ... > I have a simple database that holds jpeg images. ... >seem to get a form long enough to display the entire image. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: [SLE] view images in Konqueror
    ... > I know I'm overlooking something simple, bur since upgrading to SuSE7.2 my ... > jpeg images don't show in konqueror, but rather, just display as a red, ...
    (SuSE)
  • Re: Paginate from group by
    ... distributing the SQL query on several pages. ... Depending on how many results you want to display per page (let's say ... but I'm having a tough time trying to paginate ...
    (comp.lang.php)