1

I want to set a Bitmap to a hole Window-Object. I tested to do it with

__bmp = wx.Bitmap('/images/settings.bmp')
dc = wx.WindowDC(the_window)
dc.DrawBitmap(__bmp,0,0)

but this doesn't work. Some tipps?

One Problem is, that after creating the WindowDC object and putting the bitmap to it, the bitmap is "destroyed"

__mybmp = dc.GetAsBitmap()
print __mybmp.GetHeight()

output

0

crazy?!

alabamajack
  • 642
  • 8
  • 23
  • you may need "r" before quote. Do you know your wx.Bitmap object is created properly? And, this is on OnPaint handler right? If so, the code looks good to me. I have very similar code (except BufferedPaintDC instead of WindowDC) that is working for me. – otterb May 12 '14 at 18:42
  • The "r" is for a raw string and would only be useful if the OP was using backslashes instead of forward slashes. – Mike Driscoll May 12 '14 at 20:33
  • Yeah, I know that the Bitmap object is created, and the bitmap behind is the right one (only by get some information about the bitmap with __bmp.GetHeight() and it returned the right high – alabamajack May 13 '14 at 14:34

0 Answers0