def _WX28_clipped_agg_as_bitmap(agg, bbox):
 (l, b, width, height) = bbox.get_bounds()
 r = (l + width)
 t = (b + height)
 srcBmp = wx.BitmapFromBufferRGBA(int(agg.width), int(agg.height), agg.buffer_rgba(0, 0))
 srcDC = wx.MemoryDC()
 srcDC.SelectObject(srcBmp)
 destBmp = wx.EmptyBitmap(int(width), int(height))
 destDC = wx.MemoryDC()
 destDC.SelectObject(destBmp)
 destDC.BeginDrawing()
 x = int(l)
 y = int((int(agg.height) - t))
 destDC.Blit(0, 0, int(width), int(height), srcDC, x, y)
 destDC.EndDrawing()
 srcDC.SelectObject(wx.NullBitmap)
 destDC.SelectObject(wx.NullBitmap)
 return destBmp

def _WX28_clipped_agg_as_bitmap ( agg , bbox ) : ( l , b , width , height ) = bbox . get_bounds ( ) r = ( l + width ) t = ( b + height ) srcBmp = wx . BitmapFromBufferRGBA ( int ( agg . width ) , int ( agg . height ) , agg . buffer_rgba ( 0 , 0 ) ) srcDC = wx . MemoryDC ( ) srcDC . SelectObject ( srcBmp ) destBmp = wx . EmptyBitmap ( int ( width ) , int ( height ) ) destDC = wx . MemoryDC ( ) destDC . SelectObject ( destBmp ) destDC . BeginDrawing ( ) x = int ( l ) y = int ( ( int ( agg . height ) - t ) ) destDC . Blit ( 0 , 0 , int ( width ) , int ( height ) , srcDC , x , y ) destDC . EndDrawing ( ) srcDC . SelectObject ( wx . NullBitmap ) destDC . SelectObject ( wx . NullBitmap ) return destBmp
convert the region of a the agg buffer bounded by bbox to a wx .