示例#1
0
    def exportframe(self):
        self.frames = kinematic.makeframes()
        fsecs = self.frames.keys()
        firstpixindex = fsecs[0]

        x, y, width, height = self.mfdraw.get_allocation()
        pixmap = gtk.gdk.Pixmap(self.mfdraw.window, width, height)
        self._draw_frame(fsecs[0], pixmap)
        pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
        gtk.gdk.Pixbuf.get_from_drawable(pixbuf,pixmap,pixmap.get_colormap(),0,0,0,0,width,height)

        model.screen_shot(pixbuf)
示例#2
0
    def exportframe(self):
        self.frames = kinematic.makeframes()
        if not self.frames:
            return
        firstpixindex = list(self.frames.keys())[0]

        window = self.mfdraw.get_window()
        x, y, width, height = window.get_geometry()
        surface = self.mfdraw.get_window().create_similar_surface(
            cairo.CONTENT_COLOR, width, height)
        self._draw_frame(firstpixindex, surface)
        pixbuf = Gdk.pixbuf_get_from_window(window, x, y, width, height)

        model.screen_shot(pixbuf)
示例#3
0
    def playforwards(self):
        if self.playing:
            gobject.source_remove(self.playing)

        self.frames = kinematic.makeframes()
        fsecs = self.frames.keys()
        fsecs.sort()
        if fsecs:
            self.playframenum = fsecs[0]
        else:
            self.playframenum = -1

        logger.debug('playforwards speed=%s' % self.waittime)
        self.playingbackwards = False
        self.playing = gobject.timeout_add(self.waittime, self.playframe)
示例#4
0
    def playbackwards(self):
        if self.playing:
            GLib.source_remove(self.playing)

        self.frames = kinematic.makeframes()
        fsecs = list(self.frames.keys())
        fsecs.sort()
        if fsecs:
            self.playframenum = fsecs[-1]
        else:
            self.playframenum = -1
        self.playingbackwards = True

        logger.debug('playbackwards speed=%s' % self.waittime)
        self.playing = GLib.timeout_add(self.waittime, self.playframe)