def _py_WX28_convert_agg_to_wx_image(agg, bbox):
if bbox is None:<EOL><INDENT>image = wx.EmptyImage(int(agg.width), int(agg.height))<EOL>image.SetData(agg.tostring_rgb())<EOL>return image<EOL><DEDENT>else:<EOL><INDENT>return wx.ImageFromBitmap(_WX28_clipped_agg_as_bitmap(agg, bbox))<EOL><DEDENT>
Convert the region of the agg buffer bounded by bbox to a wx.Image.  If
bbox is None, the entire buffer is converted.

Note: agg must be a backend_agg.RendererAgg instance.