Exemplo n.º 1
0
 def send_screenshot(self):
     msg = image_t()
     msg.garb, msg.data, msg.width, msg.height,
     msg.row_stride = self.screenshot()
     msg.size = msg.row_stride * msg.height
     self.send_message("TABLET_SCRSHOT", msg.encode())
     del msg.data
Exemplo n.º 2
0
 def send_screenshot (self):
   msg = image_t ()
   msg.garb, msg.data, msg.width, msg.height,
   msg.row_stride = self.screenshot()
   msg.size = msg.row_stride * msg.height
   self.send_message ("TABLET_SCRSHOT", msg.encode())
   del msg.data
Exemplo n.º 3
0
 def init_image_from_file (self, filename):
     im = Image.open (filename)
     if im:
         img = image_t ()
         img.width = im.size[0]
         img.height = im.size[1]
         img.data = im.tostring ()
         img.row_stride = 3 * img.width
         img.pixelformat = image_t.PIXEL_FORMAT_RGB
         img.size = len (img.data)
         return img
     return None
Exemplo n.º 4
0
 def init_image_from_file(self, filename):
     im = Image.open(filename)
     if im:
         img = image_t()
         img.width = im.size[0]
         img.height = im.size[1]
         img.data = im.tostring()
         img.row_stride = 3 * img.width
         img.pixelformat = image_t.PIXEL_FORMAT_RGB
         img.size = len(img.data)
         return img
     return None
Exemplo n.º 5
0
def create_image_from_data (data, width, height, bitsperpixel):
    img = image_t ()
    img.width = width
    img.height = height
    img.size = width * height * bitsperpixel / 8
    img.data = data
    if data is None:
        img.data = "0" * img.size
    img.nmetadata = 0
    img.metadata = []
    img.utime = 0
    if bitsperpixel == 8:
        img.pixelformat = image_t.PIXEL_FORMAT_GRAY
    else:
        img.pixelformat = image_t.PIXEL_FORMAT_RGB
    img.row_stride = img.size / img.height
    return img