def toArray(self, width=-1, height=-1, scale=1.): ''' render to image buffer in RGBA format ''' if CairoSVG is None: raise ImportError('cairo extension not available') svgfh = StringIO() self.write(svgfh) svgfh.seek(0) writer = CairoSVG(svgfh) return writer.toRGBA(width, height, scale)
def toArray(self, width = -1, height = -1, scale = 1.): ''' render to image buffer in RGBA format ''' if CairoSVG is None: raise ImportError('cairo extension not available') svgfh = StringIO() self.write(svgfh) svgfh.seek(0) writer = CairoSVG(svgfh) return writer.toRGBA(width, height, scale)