3 questions

Robin,

Thank you for your reply.To my question

  1. How can I convert a large bitmap to a bitmap that is suitable (its

size) for ToolBar bitmap?

You suggested

img = bmp.ConvertToImage()

img = img.Scale(16,16)

bmp = img.COnvertToBitmap()

I tried what you suggested like this:

    self.Ad1 = wxBitmap('ad1.gif', wxBITMAP_TYPE_GIF)

    img = self.Ad1.ConvertToImage()

but I received an error

img = self.Ad1.ConvertToImage()

AttributeError: wxBitmap instance has no attribute ‘ConvertToImage’

Why?

Thanks again for help

Lad

Kind Regards,

Ladislav Blazek( Mr.)

WPM$237E.PM$ (953 Bytes)

···

BMA TRADING Ltd.

Czech Republic

email1: export@hope.cz

Tel/Fax: +420 516 447921

Tel:+420 516 447920,

Mobile:+420 602 849309

ICQ: 247175039


.

BMA TRADING wrote:

Robin,
Thank you for your reply.To my question

> 1. How can I convert a large bitmap to a bitmap that is suitable (its
> size) for ToolBar bitmap?

You suggested

img = bmp.ConvertToImage()
img = img.Scale(16,16)
bmp = img.COnvertToBitmap()

I tried what you suggested like this:

        self.Ad1 = wxBitmap('ad1.gif', wxBITMAP_TYPE_GIF)
        img = self.Ad1.ConvertToImage()

but I received an error
    img = self.Ad1.ConvertToImage()
AttributeError: wxBitmap instance has no attribute 'ConvertToImage'

Why?

Which version of wxPython are you using? That method does exist in 2.5.3.1. I thought that it also existed in 2.4 but a quick check shows that it doesn't. You should be able to do it like this in both release series:

  img = wx.ImageFromBitmap(bmp)
  img = img.Scale(16,16)
  bmp = img.ConvertToBitmap()
or
  bmp = w.xBitmapFromImage(img)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!