예제 #1
0
 def _draw_pixbuf(self):
     width = self.lcd_size[0]
     height = self.lcd_size[1]
     zoom = self.get_zoom()
     pixbuf = g15cairo.image_to_pixbuf(self.image)
     pixbuf = pixbuf.scale_simple(zoom * width, zoom * height, 0)
     if self.area is not None:
         self.area.set_pixbuf(pixbuf)
예제 #2
0
파일: driver_gtk.py 프로젝트: FPar/gnome15
 def _draw_pixbuf(self):
     width = self.lcd_size[0]
     height = self.lcd_size[1]
     zoom = self.get_zoom()
     pixbuf = g15cairo.image_to_pixbuf(self.image)
     pixbuf = pixbuf.scale_simple(zoom * width, zoom * height, 0)
     if self.area != None:
         self.area.set_pixbuf(pixbuf)
예제 #3
0
    def draw_buffer(self, img_buffer):
                
        pil_img = Image.fromstring("1", (160,43), img_buffer)
        mask_img = pil_img.copy()                           
        mask_img = mask_img.convert("L")
        pil_img = pil_img.convert("P")
        if self.plugin.palette is not None:
            pil_img.putpalette(self.plugin.palette)                              
            pil_img = pil_img.convert("RGBA")                        
            pil_img.putalpha(mask_img)                    

        # TODO find a quicker way of converting
        pixbuf = g15cairo.image_to_pixbuf(pil_img, "png")
        self.surface = g15cairo.pixbuf_to_surface(pixbuf)
        self.plugin.screen.redraw(self.page)
예제 #4
0
    def draw_buffer(self, img_buffer):

        pil_img = Image.fromstring("1", (160, 43), img_buffer)
        mask_img = pil_img.copy()
        mask_img = mask_img.convert("L")
        pil_img = pil_img.convert("P")
        if self.plugin.palette is not None:
            pil_img.putpalette(self.plugin.palette)
            pil_img = pil_img.convert("RGBA")
            pil_img.putalpha(mask_img)

            # TODO find a quicker way of converting
        pixbuf = g15cairo.image_to_pixbuf(pil_img, "png")
        self.surface = g15cairo.pixbuf_to_surface(pixbuf)
        self.plugin.screen.redraw(self.page)
예제 #5
0
def image_to_pixbuf(im, type="ppm"):
    return g15cairo.image_to_pixbuf(im, type)