Possible to display an image button over an image?
Alec Bennett <[email protected]> Tue, 31 Jan 2012 20:57:09 -0800
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <CACB9+z3HSD7nyyQbqsHC2sy8kSoJ2mmmPzkCOxfPtY2Hc+ukww@mail.gmail.com> |
--===============4724560188125719822==
Content-Type: multipart/alternative; boundary=20cf305b133876243104b7dfe922
--20cf305b133876243104b7dfe922
Content-Type: text/plain; charset=ISO-8859-1
I'm trying to display an ImageButton on top of an Image, and having some
trouble with the button disappearing behind the Image from time to time. I
know I'm asking for trouble by simply stacking these two assets, so its not
really surprising.
I tried dynamically setting the Image as a background image for the window,
but haven't been able to get that to work.
When working in straight wxPython, I do something like this:
fname = "background_image.jpg"
bmp = wx.Image(fname, wx.BITMAP_TYPE_ANY)
self.buffer = wx.BitmapFromImage(bmp)
dc = wx.BufferedDC(wx.ClientDC(self), self.buffer)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, evt):
dc = wx.BufferedPaintDC(self, self.buffer)
Can anyone think of a way to achieve this in PythonCard? I'd rather not
convert this project to straight wxPython if I can avoid it.
--20cf305b133876243104b7dfe922
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I'm trying to display an ImageButton on top of an Image, and having som=
e trouble with the button disappearing behind the Image from time to time. =
I know I'm asking for trouble by simply stacking these two assets, so i=
ts not really surprising.<br>
<br>I tried dynamically setting the Image as a background image for the win=
dow, but haven't been able to get that to work.<br><br>When working in =
straight wxPython, I do something like this:<br><br>fname =3D "backgro=
und_image.jpg"<br>
bmp =3D wx.Image(fname, wx.BITMAP_TYPE_ANY)<br>self.buffer =3D wx.BitmapFro=
mImage(bmp)<br>dc =3D wx.BufferedDC(wx.ClientDC(self), self.buffer)<br>self=
.Bind(wx.EVT_PAINT, self.OnPaint)<br><br>def OnPaint(self, evt):<br>=A0=A0=
=A0 dc =3D wx.BufferedPaintDC(self, self.buffer)<br>
<br>Can anyone think of a way to achieve this in PythonCard? I'd rather=
not convert this project to straight wxPython if I can avoid it.<br><br><b=
r><br><br>
--20cf305b133876243104b7dfe922--
--===============4724560188125719822==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
--===============4724560188125719822==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Pythoncard-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
--===============4724560188125719822==--