1. How might I display thumbnails of images...

In my program the User can search the database. Each record has several fields. One field is a sequences of paths to the images associated with that record.

What I would like to do is take the results of the search and display the first image in each record on the screen for the user to choose which record to look at. This may be one or many records in the result.

I currently use cximage which allows me to resize the original image.

new topic     » topic index » view message » categorize

2. Re: How might I display thumbnails of images...

lockiedownunder said...

In my program the User can search the database. Each record has several fields. One field is a sequences of paths to the images associated with that record.

What I would like to do is take the results of the search and display the first image in each record on the screen for the user to choose which record to look at. This may be one or many records in the result.

I currently use cximage which allows me to resize the original image.

Have you looked at using the ListView control? It was developed just for that purpose.

new topic     » goto parent     » topic index » view message » categorize

3. Re: How might I display thumbnails of images...

Yeah ListView will work if I can make the icons bigger. Say about 80 x 80.

new topic     » goto parent     » topic index » view message » categorize

4. Re: How might I display thumbnails of images...

lockiedownunder said...

Yeah ListView will work if I can make the icons bigger. Say about 80 x 80.

Ok, then make a pixmap with the 80x80 bitmaps drawn in an array fashion then a child window with scrollbars and have it's paint event draw appropriate section of the pixmap on the window's background. The scrollbars would only be needed if the entire set of bitmaps couldn't been seen in the window, of course.

new topic     » goto parent     » topic index » view message » categorize

5. Re: How might I display thumbnails of images...

Bugger I knew a listview was too easy.

Then I just need to work out where on the pixmap the users clicks to load the correct record. Dunno exactly how I will do this. Maybe too complicated for my little brain.

new topic     » goto parent     » topic index » view message » categorize

6. Re: How might I display thumbnails of images...

lockiedownunder said...

Bugger I knew a listview was too easy.

Then I just need to work out where on the pixmap the users clicks to load the correct record. Dunno exactly how I will do this. Maybe too complicated for my little brain.

Not difficult. They click on a window not the pixmap. A pixmap is just a RAM image of a bitmap and never seen by the user. That's why one needs to copy pixmaps to windows so they can be seen. Just adjust the click position by the X/Y offset you currently are using for the pixmap painting.

eg. Click occurs at 49,181 and pixmap is being displayed from 165,34, so the relative offset into the pixmap is (49+165, 181+34) = (114,199). Now if the images are 80x80 with 10 pixel margin in between images, the click occurred on the image whose origin is at 90,180, which is the second one across and the third one down.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu