Re: How might I display thumbnails of images...
- Posted by DerekParnell (admin) Jul 11, 2009
- 813 views
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.