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
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
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
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
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