#1
  1. Cast down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    321
    Rep Power
    12

    Displaying bitmaps of different sizes?


    In my program I have a ListBox. Every time you change selection a new bitmap is displayed to the right of the ListBox. I am using the wx.StaticBitmap widget.

    The bitmap does display but I have one problem. The window is not getting repainted properly. If I resize the window and/or the new bitmap is smaller than the previous one, a piece of the old bitmap is still on the surface. I am forcing a repaint of the window like this:

    self.Layout()
    self.Refresh(True)
    self.Update()

    These help. Without Layout() the sizers never re-size to accomodate the new bitmap size and without Refresh/Update more pieces get drawn. But this is still not enough, as I need to cover the window or minimize it for the full bitmap to be painted clearly. What did I miss?

    I added screen shots. The first one shows how the bitmap looks when I first move the selection to it. The second shows the pic after I press a button or cover that part of the window.

    [img=http://img153.imageshack.us/img153/7808/before0xh.th.png]
    [img=http://img153.imageshack.us/img153/3313/after2eh.th.png]

    BTW those are 3 different wxStaticBitmap widgets.
    Last edited by movEAX_444; June 30th, 2005 at 02:22 AM.

IMN logo majestic logo threadwatch logo seochat tools logo