How to delete bitmap of BitmapButton?

Hi!

I fill up the Bitmap with SetBitmapLabel method.

But how to delete it - initialize the component like in the starting of the program.

When I set it None, I got error message.

When I set it wxEmptyBitmap, I also got it.

With Py 25 I don’t got these errors. With 2.6 and last wx (unicode) I got it.

What is the solution?

Thanks for your help:

dd

Why are you trying to delete a bitmap from a bitmap button? That seems kind of counter-intuitive to me. Why not just use a regular wx.Button instead?

···

On Wed, Nov 11, 2009 at 12:32 PM, Durumdara durumdara@gmail.com wrote:

Hi!

I fill up the Bitmap with SetBitmapLabel method.

But how to delete it - initialize the component like in the starting of the program.

When I set it None, I got error message.

When I set it wxEmptyBitmap, I also got it.

With Py 25 I don’t got these errors. With 2.6 and last wx (unicode) I got it.

What is the solution?

Thanks for your help:

dd


Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hi!

So: I have a Photo tool. I create many images from the main photos, and these images are modified with spec. effects. XNVIew-NConvert, AutoLevels, AutoContrast, etc.
I have a program (wx) that shows selected image, and all images are visible in bitmapbuttons.
When I clicked on button, I select this mode. Later I keep only this photo…

But when not photos in a directory, or some images are missing, I want to delete it from the button, like when I never set bitmap…

But how to I do with Py2.6/Last Uni Wx?

Thanks for your help:
dd

···

2009/11/11 Mike Driscoll mike@pythonlibrary.org

On Wed, Nov 11, 2009 at 12:32 PM, Durumdara durumdara@gmail.com wrote:

Hi!

I fill up the Bitmap with SetBitmapLabel method.

But how to delete it - initialize the component like in the starting of the program.

When I set it None, I got error message.

When I set it wxEmptyBitmap, I also got it.

With Py 25 I don’t got these errors. With 2.6 and last wx (unicode) I got it.

What is the solution?

Thanks for your help:

dd

Why are you trying to delete a bitmap from a bitmap button? That seems kind of counter-intuitive to me. Why not just use a regular wx.Button instead?


Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hi,

Hi!

So: I have a Photo tool. I create many images from the main photos, and
these images are modified with spec. effects. XNVIew-NConvert, AutoLevels,
AutoContrast, etc.
I have a program (wx) that shows selected image, and all images are visible
in bitmapbuttons.
When I clicked on button, I select this mode. Later I keep only this
photo...

But when not photos in a directory, or some images are missing, I want to
delete it from the button, like when I never set bitmap...

But how to I do with Py2.6/Last Uni Wx?

Thanks for your help:
dd

I don't see an obvious way to do this with the current API. I looked
at the GenBitmapButton too, but it doesn't appear to support this
functionality out of the box either. Of course, the latter is a pure
python widget, so theoretically, you could subclass it and make it do
this.

Otherwise, the only thing that springs to mind is to delete (or hide)
the button and create (or show) a new one in its place.

···

On Nov 12, 2:00 am, Durumdara <durumd...@gmail.com> wrote:

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hi!

I don’t see an obvious way to do this with the current API. I looked

at the GenBitmapButton too, but it doesn’t appear to support this

functionality out of the box either. Of course, the latter is a pure

python widget, so theoretically, you could subclass it and make it do

this.

Otherwise, the only thing that springs to mind is to delete (or hide)

the button and create (or show) a new one in its place.

Interesting that it was working with Py2.5 and wxpy (older) version (wx.EmptyBitmap).

Thanks for your check, and for your time.

Possible that solution is if I don’t use buttons - I can use staticbmp, other my image component, or some listview, or other thing that can show list of images…

The main problem with the program: this is the speed… I convert these images before I choose optimal version, but these images are 1-2 MB size jpg files.

10 images = 10-20 MB, and I need to resize them all to mini buttons.

These mini images can help me to see all the versions, but they are very little to see little differents; and this time I need to see the bigger pictures.

For example:
I see that these tree pictures are better with “AutoLevels”. I periodically push “AutoLevels” button to select these versions. But later I got red flower pictures. For these images the HLS is better now.

Then I change… And so on.

So very hard to realize, how to speed up this image selection method…

Thanks for your all idea:
dd

···

2009/11/12 Mike Driscoll kyosohma@gmail.com

It sounds like you may want something like:

http://xoomer.virgilio.it/infinity77/main/freeware.html#thumbnailctrl

But back to your original question: What does wx.BitmapButton display when you don't set a bitmap -- it has to display SOMETHING?

So I'd decide what you want the "no image" button to look like, and make a bitmap for it, and put that on your button.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

I think I would just replace it with a transparent bitmap.

···

On 11/12/09 12:00 AM, Durumdara wrote:

Hi!

So: I have a Photo tool. I create many images from the main photos, and
these images are modified with spec. effects. XNVIew-NConvert,
AutoLevels, AutoContrast, etc.
I have a program (wx) that shows selected image, and all images are
visible in bitmapbuttons.
When I clicked on button, I select this mode. Later I keep only this
photo...

But when not photos in a directory, or some images are missing, I want
to delete it from the button, like when I never set bitmap...

But how to I do with Py2.6/Last Uni Wx?

--
Robin Dunn
Software Craftsman