[Tutor] [pygtk] taking image of gtk.drawing area

saeed saeed.gnu at gmail.com
Fri Jun 19 22:13:01 CEST 2009


JPEG doesn't support alpha (transparency), try with PNG or GIF.

On 6/19/09, Amit Sethi <amit.pureenergy at gmail.com> wrote:
> 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
>


More information about the Tutor mailing list