コード例 #1
0
 def test_paste(self):
     test_image = get_image("canvas_13.png")
     image_to_paste = get_image("canvas_14.png")
     o = get_mock_output(mode="RGB")
     c = Canvas(o, name=c_name)
     c.text("Hello world", (16, 16))
     c.paste(image_to_paste)
     assert (c.get_image().mode == o.device_mode)
     assert (imgs_are_equal(c.get_image(), test_image.convert("RGB")))
コード例 #2
0
ファイル: main.py プロジェクト: hpagseddy/ZPUI
 def learn_about_help_icon(self):
     o = HelpOverlay("test")
     c = Canvas(self.o)
     c.text("See this icon?->", (1, 1))
     c.text("When it appears,", (3, 10))
     c.text("press F5 to get help", (3, 19))
     c.text("Try now, or", (3, 28))
     c.text("press ENTER to skip", (3, 37))
     if not is_emulator():
         c.text("F5:", (5, 51))
         c.paste(local_path("f5_button_location.png"), (30, 50),
                 invert=True)
     o.draw_icon(c)
     Refresher(c.get_image,
               self.i,
               self.o,
               keymap={
                   "KEY_ENTER": "deactivate",
                   "KEY_F5": self.on_help_button_press
               }).activate()
     return True
コード例 #3
0
ファイル: main.py プロジェクト: hpagseddy/ZPUI
 def learn_about_zeromenu(self):
     c = Canvas(self.o)
     if is_emulator():
         c.text("Press F11 to get", (1, 1))
     else:
         c.text("Press PROG2 to get", (1, 1))
     c.text("a shortcut menu -", (3, 10))
     c.text("ZeroMenu. You can", (3, 19))
     c.text("add apps to it", (3, 28))
     c.text("for quick launch", (3, 37))
     if not is_emulator():
         c.text("PROG2:", (5, 51))
         c.paste(local_path("prog2_button_location.png"), (40, 50),
                 invert=True)
     Refresher(c.get_image,
               self.i,
               self.o,
               keymap={
                   "KEY_ENTER": "deactivate",
                   "KEY_PROG2": self.on_zeromenu_button_press
               }).activate()
     return True