From: Milan Babuskov on
Hello,

I'm looking for a control that is able to show multiple image (jpg, png)
thumbnails in a kind of a grid. Image are all same sizes (at least one
of dimensions is the same) and the control should automatically create
rows/columns depending on how much space is available to it. Also, it
should be able to detect clicks on each image.

I was thinking to maybe use wxHTML, but I have two problems: one is that
I'm not sure how to handle rows/columns, as HTML table would have to
have a fixed number of columns. The second problem is that images are
not files stored on disk, but files that come from the database.

The other alternative is to create a custom control that paints (via
wxDC) itself and does exactly what I want it to. Does anyone know if
such control already exists, so I don't have to write it from scratch?


As for control's interface, I think it could accept wxImageList and
render all the images it finds there. Is wxImageList suitable for
storing thousand or more images? All images would be about 200x200 pixels.

TIA

--
Milan Babuskov
http://www.guacosoft.com


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Stephan Rose on
On Thursday 15 February 2007 19:52, Milan Babuskov wrote:
> Hello,
>
> I'm looking for a control that is able to show multiple image (jpg, png)
> thumbnails in a kind of a grid. Image are all same sizes (at least one
> of dimensions is the same) and the control should automatically create
> rows/columns depending on how much space is available to it. Also, it
> should be able to detect clicks on each image.
>
> I was thinking to maybe use wxHTML, but I have two problems: one is that
> I'm not sure how to handle rows/columns, as HTML table would have to
> have a fixed number of columns. The second problem is that images are
> not files stored on disk, but files that come from the database.
>
> The other alternative is to create a custom control that paints (via
> wxDC) itself and does exactly what I want it to. Does anyone know if
> such control already exists, so I don't have to write it from scratch?
>
>
> As for control's interface, I think it could accept wxImageList and
> render all the images it finds there. Is wxImageList suitable for
> storing thousand or more images? All images would be about 200x200 pixels.
>
> TIA

What I would do is write my own control as I doubt you will find anything
existing to fit those needs.

Even if you find a thumbnail control, I doubt it will be designed to deal with
thousands of images.

I would also advise against loading all the images into an image list. Just
get out the calculator...

200x200 pixels at 24 bits per pixel is 117 kb per image. So 117 megs every
1,000 images. That is quite some memory consumption just to show a few
thumbnails on the screen.

I would request the images I want from my data source on the fly and maybe
cache the last 100 images or so in a circular list so that the oldest ones
always automatically get thrown out as new images are put in it.

Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Julian Smart on
Hi,

There is the wxThumbnailCtrl used as an example in the wxWidgets book,
which I may add to wxWidgets 2.9.

Screenshot of app using it on Mac OS X:
http://www.anthemion.co.uk/wxwin/thumbnailctrl-macosx.jpg

Source:
http://www.anthemion.co.uk/wxwin/thumbnail.zip

It does currently use wxBitmaps for the thumbnails, but you could derive
a new class from wxThumbnailItem and add caching.

Regards,

Julian

Milan Babuskov wrote:
> Hello,
>
> I'm looking for a control that is able to show multiple image (jpg,
> png) thumbnails in a kind of a grid. Image are all same sizes (at
> least one of dimensions is the same) and the control should
> automatically create rows/columns depending on how much space is
> available to it. Also, it should be able to detect clicks on each image.
>
> I was thinking to maybe use wxHTML, but I have two problems: one is
> that I'm not sure how to handle rows/columns, as HTML table would have
> to have a fixed number of columns. The second problem is that images
> are not files stored on disk, but files that come from the database.
>
> The other alternative is to create a custom control that paints (via
> wxDC) itself and does exactly what I want it to. Does anyone know if
> such control already exists, so I don't have to write it from scratch?
>
>
> As for control's interface, I think it could accept wxImageList and
> render all the images it finds there. Is wxImageList suitable for
> storing thousand or more images? All images would be about 200x200
> pixels.
>
> TIA
>


--
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD: www.anthemion.co.uk/dialogblocks


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Milan Babuskov on
Stephan Rose wrote:
> I would also advise against loading all the images into an image list. Just
> get out the calculator...
>
> 200x200 pixels at 24 bits per pixel is 117 kb per image. So 117 megs every
> 1,000 images. That is quite some memory consumption just to show a few
> thumbnails on the screen.
>
> I would request the images I want from my data source on the fly and maybe
> cache the last 100 images or so in a circular list so that the oldest ones
> always automatically get thrown out as new images are put in it.

Thanks, I'll keep this in mind.


--
Milan Babuskov
http://www.guacosoft.com
http://www.flamerobin.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Milan Babuskov on
Julian Smart wrote:
> There is the wxThumbnailCtrl used as an example in the wxWidgets book,
> which I may add to wxWidgets 2.9.
>
> Screenshot of app using it on Mac OS X:
> http://www.anthemion.co.uk/wxwin/thumbnailctrl-macosx.jpg

Great. It looks exactly as I imagined. I guess I should read that book
after all.

> Source:
> http://www.anthemion.co.uk/wxwin/thumbnail.zip
>
> It does currently use wxBitmaps for the thumbnails, but you could derive
> a new class from wxThumbnailItem and add caching.

I'll look into it, if I decide to use and improve it, I'll send patches.

Thanks,

--
Milan Babuskov
http://www.guacosoft.com
http://www.flamerobin.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

 | 
Pages: 1
Prev: ActiveX objects help request
Next: wxXmlDocument