transparent image???

Hello, I have a wxpython application and I just created a banner during start up that is just a wxframe with a bitmap image in it. It appears just great on my computer. however I installed my program on my work computer and the image is appears but it is transparent??? what might be the problem? I attached the code for the frame containing the banner. thanks!

Jeff

Banner.py (1.83 KB)

···

Yahoo! Mail

Use Photomail to share photos without annoying attachments.

Hi Jeff. I make my images as png. In Fireworks if I am making an 8 bit png, I need to specify whether I want alpha transparency when I export the image for use. If it is 24 or 32 bit png transparency is implicit. I would suspect that if you can see your image, then the problem is the image itself.

On another note, it is probably a bad idea to include a direct reference to the image as you have for portability of your app. I would use the img2py utility included in wxPython, include your image in a module and then call it with a method.

MyImages.getBannerBitmap()

where MyImages (or whatever you want to call your module) is a module containing the image methods generated by img2py. You can easily append images you have for your app to the module. Hope this helps.

Regards,
David

Jeff Peery wrote:

···

Hello, I have a wxpython application and I just created a banner during start up that is just a wxframe with a bitmap image in it. It appears just great on my computer. however I installed my program on my work computer and the image is appears but it is transparent??? what might be the problem? I attached the code for the frame containing the banner. thanks!

Jeff

------------------------------------------------------------------------
Yahoo! Mail
Use Photomail <Yahooist Teil der Yahoo Markenfamilie; to share photos without annoying attachments.

------------------------------------------------------------------------

#Boa:Frame:Banner

import wx

def create(parent):
    return Banner(parent)

[wxID_BANNER, wxID_BANNERSTATICBITMAP1, ] = [wx.NewId() for _init_ctrls in range(2)]

[wxID_BANNERTIMER1] = [wx.NewId() for _init_utils in range(1)]

class Banner(wx.Frame):
    def _init_coll_boxSizer1_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.staticBitmap1, 1, border=0, flag=wx.EXPAND)

    def _init_utils(self):
        # generated method, don't edit
        self.timer1 = wx.Timer(id=wxID_BANNERTIMER1, owner=self)
        self.Bind(wx.EVT_TIMER, self.OnTimer1Timer, id=wxID_BANNERTIMER1)

    def _init_sizers(self):
        # generated method, don't edit
        self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)

        self._init_coll_boxSizer1_Items(self.boxSizer1)

        self.SetSizer(self.boxSizer1)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_BANNER, name='Banner', parent=prnt,
              pos=wx.Point(541, 305), size=wx.Size(667, 257),
              style=wx.NO_3D | wx.NO_BORDER | wx.FRAME_FLOAT_ON_PARENT,
              title='')
        self._init_utils()
        self.SetClientSize(wx.Size(659, 217))

        self.staticBitmap1 = wx.StaticBitmap(bitmap=wx.Bitmap('C:/Documents and Settings/Jeffrey Peery/My Documents/Code/PYTHON APPLICATIONS/Avance Engineering/Figures/banner.bmp',
              wx.BITMAP_TYPE_BMP), id=wxID_BANNERSTATICBITMAP1,
              name='staticBitmap1', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(659, 217), style=0)
        self.staticBitmap1.Center(wx.VERTICAL)
        self.staticBitmap1.SetToolTipString('')

        self._init_sizers()

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.timer1.Start(5000)
            def OnTimer1Timer(self, event):
        self.Destroy()

------------------------------------------------------------------------

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

Jeff Peery wrote:

Hello, I have a wxpython application and I just created a banner during start up that is just a wxframe with a bitmap image in it. It appears just great on my computer. however I installed my program on my work computer and the image is appears but it is transparent??? what might be the problem? I attached the code for the frame containing the banner. thanks!

What platforms are your home computer and work computer? Are they both using the same version of wxPython? What do you mean by transparant, is the image shown at all? Do you see the desktop behind it? Or the frame background?

···

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

Hi Robin,
the frame appeared and I could see right through it into the desktop. but I think I found my problem. I was referencing an image on my computer and when I switched computers the path to that image was no longer correct. oops. Thanks all for the help!

···

Robin Dunn robin@alldunn.com wrote:

Jeff Peery wrote:

Hello, I have a wxpython application and I just created a banner during
start up that is just a wxframe with a bitmap image in it. It appears
just great on my computer. however I installed my program on my work
computer and the image is appears but it is transparent??? what might be
the problem? I attached the code for the frame containing the banner.
thanks!

What platforms are your home computer and work computer? Are they both
using the sam
e
version of wxPython? What do you mean by transparant, is
the image shown at all? Do you see the desktop behind it? Or the
frame background?


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


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


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!