Beispiel #1
0
    def draw_event(self, widget, cr):
        self.logger.debug("updating window from surface")
        if six.PY2:
            # redraw the screen from backing surface
            cr.set_source_surface(self.surface, 0, 0)
        else:
            # see NOTE [1] above
            arr8 = self.get_image_as_array()
            pixbuf = GtkHelp.pixbuf_new_from_array(arr8, GdkPixbuf.Colorspace.RGB, 8)
            Gdk.cairo_set_source_pixbuf(cr, pixbuf, 0, 0)

        cr.set_operator(cairo.OPERATOR_SOURCE)
        cr.paint()
        return False
Beispiel #2
0
    def draw_event(self, widget, cr):
        self.logger.debug("updating window from surface")
        if six.PY2:
            # redraw the screen from backing surface
            cr.set_source_surface(self.surface, 0, 0)
        else:
            # see NOTE [1] above
            arr8 = self.get_image_as_array()
            pixbuf = GtkHelp.pixbuf_new_from_array(arr8,
                                                   GdkPixbuf.Colorspace.RGB, 8)
            Gdk.cairo_set_source_pixbuf(cr, pixbuf, 0, 0)

        cr.set_operator(cairo.OPERATOR_SOURCE)
        cr.paint()
        return False
Beispiel #3
0
 def get_plain_image_as_pixbuf(self):
     arr = self.getwin_array(order='RGB', dtype=np.uint8)
     pixbuf = GtkHelp.pixbuf_new_from_array(arr, GdkPixbuf.Colorspace.RGB,
                                            8)
     return pixbuf
Beispiel #4
0
 def get_image_as_pixbuf(self):
     arr = self.getwin_array(order='RGB')
     pixbuf = GtkHelp.pixbuf_new_from_array(arr,
                                            GdkPixbuf.Colorspace.RGB,
                                            8)
     return pixbuf