RMaixtr 1 年之前
父节点
当前提交
82db962605
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 6 1
      backup/preset/app/checkout.py
  2. 6 1
      backup/preset/app/pull.py

+ 6 - 1
backup/preset/app/checkout.py

@@ -1,5 +1,6 @@
 import git
 import os
+from maix import camera, display, image  # 引入python模块包
 from io import RawIOBase
 
 localrep = "/home"
@@ -18,7 +19,11 @@ class NewStream(RawIOBase):
         return None
 
     def write(self, b):
-        print(b)
+        hello_img = image.new(size=(320, 240), color=(0, 0, 0),
+                              mode="RGB")  # 创建一张黑色背景图
+        hello_img.draw_string(10, 115, str(b), scale=1.0, color=(255, 255, 255),
+                              thickness=1)  # 在黑色背景图上写下hello world
+        display.show(hello_img)  # 把这张图显示出来
         return None
 
 

+ 6 - 1
backup/preset/app/pull.py

@@ -1,5 +1,6 @@
 import git
 import os
+from maix import camera, display, image  # 引入python模块包
 from io import RawIOBase
 
 localrep = "/home"
@@ -18,7 +19,11 @@ class NewStream(RawIOBase):
         return None
 
     def write(self, b):
-        print(b)
+        hello_img = image.new(size=(320, 240), color=(0, 0, 0),
+                              mode="RGB")  # 创建一张黑色背景图
+        hello_img.draw_string(10, 115, str(b), scale=1.0, color=(255, 255, 255),
+                              thickness=1)  # 在黑色背景图上写下hello world
+        display.show(hello_img)  # 把这张图显示出来
         return None