Пример #1
0
    def expose(self, widget, event=None):
        cr = widget.window.cairo_create()
        if self.is_composited and self.supports_alpha and not self.ffb:
            cr.set_operator(cairo.OPERATOR_CLEAR)
            cr.set_source_rgba(0, 0, 0, 0)
            cr.paint()
            if self.mouse_down:
                cr.rectangle(self.x, self.y, self.dx, self.dy)

        else:
            cr.set_operator(cairo.OPERATOR_SOURCE)
            if self.pixbuf is None:
                self.pixbuf = screencapper.capture_screen()
                cr.set_source_pixbuf(self.pixbuf, 0, 0)
                cr.paint()

            if self.mouse_down:
                cr.rectangle(self.x, self.y, self.dx, self.dy)
                cr.stroke()

        return False
Пример #2
0
    def expose(self, widget, event=None):
        cr = widget.window.cairo_create()
        if self.is_composited and self.supports_alpha and not self.ffb:
            cr.set_operator(cairo.OPERATOR_CLEAR)
            cr.set_source_rgba(0, 0, 0, 0)
            cr.paint()
            if self.mouse_down:
                cr.rectangle(self.x, self.y, self.dx, self.dy)
            
        else:
            cr.set_operator(cairo.OPERATOR_SOURCE)
            if self.pixbuf is None:
                self.pixbuf = screencapper.capture_screen()
                cr.set_source_pixbuf(self.pixbuf, 0, 0)
                cr.paint()

            if self.mouse_down:
                cr.rectangle(self.x, self.y, self.dx, self.dy)
                cr.stroke()
        
        return False
Пример #3
0
def do_capture_screen():
    handle_delay()
    pb = screencapper.capture_screen()
    return uploader.upload_pixbuf(pb)