Exemplo n.º 1
0
 def draw(self, drawDC=None):
     width = int(self.figure.bbox.width)
     height = int(self.figure.bbox.height)
     surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
     self._renderer.set_ctx_from_surface(surface)
     self._renderer.set_width_height(width, height)
     self.figure.draw(self._renderer)
     self.bitmap = wxcairo.BitmapFromImageSurface(surface)
     self._isDrawn = True
     self.gui_repaint(drawDC=drawDC, origin='WXCairo')
Exemplo n.º 2
0
 def draw(self, drawDC=None):
     size = self.figure.bbox.size.astype(int)
     surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, *size)
     self._renderer.set_ctx_from_surface(surface)
     self._renderer.set_width_height(*size)
     self._renderer.dpi = self.figure.dpi
     self.figure.draw(self._renderer)
     self.bitmap = wxcairo.BitmapFromImageSurface(surface)
     self._isDrawn = True
     self.gui_repaint(drawDC=drawDC)