code: def _WX28_clipped_agg_as_bitmap(agg, bbox):
      """
      Convert the region of a the agg buffer bounded by bbox to a wx.Bitmap.
  
      Note: agg must be a backend_agg.RendererAgg instance.
      """
      l, b, width, height = bbox.bounds
      r = l + width
      t = b + height
  
      srcBmp = wxc.BitmapFromBuffer(
          int(agg.width), int(agg.height), agg.buffer_rgba()
      )
      srcDC = wx.MemoryDC()
      srcDC.SelectObject(srcBmp)
  
      destBmp = wxc.EmptyBitmap(int(width), int(height))
      destDC = wx.MemoryDC()
      destDC.SelectObject(destBmp)
  
      x = int(l)
      y = int(int(agg.height) - t)
      destDC.Blit(0, 0, int(width), int(height), srcDC, x, y)
  
      srcDC.SelectObject(wx.NullBitmap)
      destDC.SelectObject(wx.NullBitmap)
  
      return destBmp
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import wx
  import matplotlib
  from matplotlib import cbook
  from .None import wx_compat
  from .backend_agg import FigureCanvasAgg
  from .backend_wx import _BackendWx, _FigureCanvasWxBase, FigureFrameWx, NavigationToolbar2Wx
label_desc: Use image node_id 3 for calling a global function with example usage: _WX28_clipped_agg_as_bitmap(agg, bbox) and returns: destBmp