def _py_convert_agg_to_wx_image(agg, bbox):
 image = wx.EmptyImage(int(agg.width), int(agg.height))
 image.SetData(agg.tostring_rgb())
 if (bbox is None):
  return image
 else:
  return wx.ImageFromBitmap(_clipped_image_as_bitmap(image, bbox))

def _py_convert_agg_to_wx_image ( agg , bbox ) : image = wx . EmptyImage ( int ( agg . width ) , int ( agg . height ) ) image . SetData ( agg . tostring_rgb ( ) ) if ( bbox is None ) : return image else : return wx . ImageFromBitmap ( _clipped_image_as_bitmap ( image , bbox ) )
convert the region of the agg buffer bounded by bbox to a wx .