parameters: (self, bmp, x, y, w=-1, h=-1)
docstring: Draw the bitmap at (x,y).  If the width and height parameters
          are passed then the bitmap is scaled to fit that size.  Either
          a wx.Bitmap or a GraphicsBitmap may be used.
docstring_summary: Draw the bitmap at (x,y).  If the width and height parameters
          are passed then the bitmap is scaled to fit that size.  Either
          a wx.Bitmap or a GraphicsBitmap may be used.
docstring_tokens: Draw the bitmap at ( x y ) . If the width and height parameters are passed then the bitmap is scaled to fit that size . Either a wx . Bitmap or a GraphicsBitmap may be used .
function: def DrawBitmap(self, bmp, x, y, w=-1, h=-1):
          """
          Draw the bitmap at (x,y).  If the width and height parameters
          are passed then the bitmap is scaled to fit that size.  Either
          a wx.Bitmap or a GraphicsBitmap may be used.
          """
          if isinstance(bmp, wx.Bitmap):
              bmp = GraphicsBitmap.CreateFromBitmap(bmp)
  
          # In case we're scaling the image by using a width and height
          # different than the bitmap's size, create a pattern
          # transformation on the surface and draw the transformed
          # pattern.
          self.PushState()
          pattern = cairo.SurfacePattern(bmp.Surface)
  
          bw, bh = bmp.Size
          if w == -1: w = bw
          if h == -1: h = bh
          scaleX = w / float(bw)
          scaleY = h / float(bh)
  
          self._context.translate(x, y)
          self._context.scale(scaleX, scaleY)
          self._context.set_source(pattern)
  
          # use the original size here since the context is scaled already...
          self._context.rectangle(0, 0, bw, bh)
          # fill the rectangle with the pattern
          self._context.fill()
          
          self.PopState()
function_tokens: def DrawBitmap ( self , bmp , x , y , w = - 1 , h = - 1 ) : if isinstance ( bmp , wx . Bitmap ) : bmp = GraphicsBitmap . CreateFromBitmap ( bmp ) # In case we're scaling the image by using a width and height # different than the bitmap's size, create a pattern # transformation on the surface and draw the transformed # pattern. self . PushState ( ) pattern = cairo . SurfacePattern ( bmp . Surface ) bw , bh = bmp . Size if w == - 1 : w = bw if h == - 1 : h = bh scaleX = w / float ( bw ) scaleY = h / float ( bh ) self . _context . translate ( x , y ) self . _context . scale ( scaleX , scaleY ) self . _context . set_source ( pattern ) # use the original size here since the context is scaled already... self . _context . rectangle ( 0 , 0 , bw , bh ) # fill the rectangle with the pattern self . _context . fill ( ) self . PopState ( )