[Tutor] taking image of gtk.drawing area

Amit Sethi amit.pureenergy at gmail.com
Fri Jun 19 13:21:03 CEST 2009


Hi ,
I am trying to take image of a gst video playing in the gtk.drawingarea i am
using following code for it :

def snap_shot(self,widget,data=None):
        global file_loc   ,pixbuf
        self.pipeline.set_state(gst.STATE_PAUSED)
        pixbuf = gtk.gdk.Pixbuf( gtk.gdk.COLORSPACE_RGB, False, 8, 640, 480)
            pixbuf.get_from_drawable( self.movie_window.window,
self.movie_window.get_colormap(), 0, 0, 0, 0, 640, 480)
        file_loc="/tmp/bar%d"%time.time()
        pixbuf.save(file_loc,'jpeg', {'quality':'100'})
        self.pipeline.set_state(gst.STATE_PLAYING)

but the movie seems to momentarily stop and i am left with a dark image
where i might be going wrong??

-- 
A-M-I-T S|S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090619/2208c81b/attachment.htm>


More information about the Tutor mailing list