displaying resized images

im creating a program that will search a directory for images and display them on buttons (wx.BitmapButton) on a grid (sizer) but im having problems getting the images to resize to fit the buttons, i can resize all the images by hand but i want to preserve the original images and not take up space with resized coppies of all the images, i will be continualy adding images to this directory and the size would get pretty big if i had to make coppies and resize all the images. what im looking for is a way to DISPLAY the images smaller, without having to MAKE the images smaller. any help would be greatly appreciated.

thanks
Justin

Have you tried Andrea’s
http://xoomer.alice.it/infinity77/eng/ThumbnailCtrl.html
maybe it does what you need.

If you still want to use your own implementation… I suggest keeping some kind of thumbnail database, the resized images are not all that big…

···

On 7/19/06, justin mcguire jherrico@gmail.com wrote:

im creating a program that will search a directory for images and display them on buttons (wx.BitmapButton) on a grid (sizer) but im having problems getting the images to resize to fit the buttons, i can resize all the images by hand but i want to preserve the original images and not take up space with resized coppies of all the images, i will be continualy adding images to this directory and the size would get pretty big if i had to make coppies and resize all the images. what im looking for is a way to DISPLAY the images smaller, without having to MAKE the images smaller. any help would be greatly appreciated.

thanks

Justin


Peter Damoc
Lead developer for
Inamed CAIS Planning System
http://www.cms.ro/cais/

i have looked into Andrea’s widget and it looks promising but i need the resized images to be placed on a button and i dont think that i can do that with ThumbnailCtrl. i know that the thumbnail images are not that big but i was trying to avoid writing the code to copy and convert the images when they are inputed into the program.

···

On 7/19/06, Peter Damoc pdamoc@gmail.com wrote:

Have you tried Andrea’s

http://xoomer.alice.it/infinity77/eng/ThumbnailCtrl.html

maybe it does what you need.

If you still want to use your own implementation… I suggest keeping some kind of thumbnail database, the resized images are not all that big…

On 7/19/06, justin mcguire < > jherrico@gmail.com> wrote:

im creating a program that will search a directory for images and display them on buttons (wx.BitmapButton) on a grid (sizer) but im having problems getting the images to resize to fit the buttons, i can resize all the images by hand but i want to preserve the original images and not take up space with resized coppies of all the images, i will be continualy adding images to this directory and the size would get pretty big if i had to make coppies and resize all the images. what im looking for is a way to DISPLAY the images smaller, without having to MAKE the images smaller. any help would be greatly appreciated.

thanks

Justin


Peter Damoc
Lead developer for
Inamed CAIS Planning System

http://www.cms.ro/cais/

Have you looked into wx.wxArtProvider and the method GetBitmap?

Look that the wxPython Demo application and the wxTreeCtrl for an example. The third parameter takes (w,h)

Best Regards,

Richard Burton

···

On 7/19/06, justin mcguire jherrico@gmail.com wrote:

i have looked into Andrea’s widget and it looks promising but i need the resized images to be placed on a button and i dont think that i can do that with ThumbnailCtrl. i know that the thumbnail images are not that big but i was trying to avoid writing the code to copy and convert the images when they are inputed into the program.

On 7/19/06, Peter Damoc < > pdamoc@gmail.com> wrote:

Have you tried Andrea’s
[

http://xoomer.alice.it/infinity77/eng/ThumbnailCtrl.html](http://xoomer.alice.it/infinity77/eng/ThumbnailCtrl.html)
maybe it does what you need.

If you still want to use your own implementation… I suggest keeping some kind of thumbnail database, the resized images are not all that big…

On 7/19/06, justin mcguire < > > > > jherrico@gmail.com> wrote:

im creating a program that will search a directory for images and display them on buttons (wx.BitmapButton) on a grid (sizer) but im having problems getting the images to resize to fit the buttons, i can resize all the images by hand but i want to preserve the original images and not take up space with resized coppies of all the images, i will be continualy adding images to this directory and the size would get pretty big if i had to make coppies and resize all the images. what im looking for is a way to DISPLAY the images smaller, without having to MAKE the images smaller. any help would be greatly appreciated.

thanks

Justin


Peter Damoc
Lead developer for
Inamed CAIS Planning System
[

http://www.cms.ro/cais/](http://www.cms.ro/cais/)


-Richard Burton

ill check that out, in the meantime if anybody has any other sugestions the are welcome.

···

On 7/19/06, Richard Burton mrburton@gmail.com wrote:

Have you looked into wx.wxArtProvider and the method GetBitmap?

Look that the wxPython Demo application and the wxTreeCtrl for an example. The third parameter takes (w,h)

Best Regards,

Richard Burton

On 7/19/06, justin mcguire < > jherrico@gmail.com> wrote:

i have looked into Andrea’s widget and it looks promising but i need the resized images to be placed on a button and i dont think that i can do that with ThumbnailCtrl. i know that the thumbnail images are not that big but i was trying to avoid writing the code to copy and convert the images when they are inputed into the program.

On 7/19/06, Peter Damoc < > > pdamoc@gmail.com> wrote:

Have you tried Andrea’s

http://xoomer.alice.it/infinity77/eng/ThumbnailCtrl.html

maybe it does what you need.

If you still want to use your own implementation… I suggest keeping some kind of thumbnail database, the resized images are not all that big…

On 7/19/06, justin mcguire < > > > jherrico@gmail.com> wrote:

im creating a program that will search a directory for images and display them on buttons (wx.BitmapButton) on a grid (sizer) but im having problems getting the images to resize to fit the buttons, i can resize all the images by hand but i want to preserve the original images and not take up space with resized coppies of all the images, i will be continualy adding images to this directory and the size would get pretty big if i had to make coppies and resize all the images. what im looking for is a way to DISPLAY the images smaller, without having to MAKE the images smaller. any help would be greatly appreciated.

thanks

Justin


Peter Damoc
Lead developer for
Inamed CAIS Planning System

http://www.cms.ro/cais/

-Richard Burton

justin mcguire wrote:

ill check that out, in the meantime if anybody has any other sugestions the are welcome.

maybe I'm missing something, but this is pretty trivial:

load the image into a wx.Image

I = wx.Image(filename)

resize it

I.Rescale(NewWidth, NewHeight)

turn it into a bitmap

B = wx.BitmapFromImage(I)

put it on the button

Button = wx.BitmapButton(parent, bitmap= B)

presto!

-CHB

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

that worked perfectly, thank you for your help

···

On 7/19/06, Christopher Barker Chris.Barker@noaa.gov wrote:

justin mcguire wrote:

ill check that out, in the meantime if anybody has any other sugestions

the are welcome.

maybe I’m missing something, but this is pretty trivial:

load the image into a wx.Image

I = wx.Image(filename)

resize it

I.Rescale(NewWidth, NewHeight)

turn it into a bitmap

B = wx.BitmapFromImage(I)

put it on the button

Button = wx.BitmapButton(parent, bitmap= B)

presto!

-CHB


Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959 voice

7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org