Pierre Barthelemy | 5 Jun 2012 18:28
Picon

PyQt and Chaco: copy plot container to clipboard

Hello,

i am trying to copy Chaco Plot container onto the clipboard. I tried to adapt what is explained on the manual http://code.enthought.com/projects/chaco/docs/Chaco.pdf fur using pyQt. However, the following code has a problem: when i paste from the clipboard, i only have a black image. Could someone tell me what i did wrong ? 



width, height = plot.container.outer_bounds
gc = PlotGraphicsContext((width, height), dpi=72)
gc.render_component(plot.container)
        
bitmap=QtGui.QImage(gc.bmp_array)
clipboard=figure._parent.clipboard  #QApplication.clipboard()
clipboard.setImage(bitmap)


Bests,

Pierre


_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane