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

Note: agg must be a backend_agg.RendererAgg instance.