12_pictureLoopPlay.py 832 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. #version : 2023.12.31
  3. #language : ch
  4. from maix import display
  5. from maix import image
  6. from maix import camera
  7. import time
  8. camera.camera.config(size=(320,240))
  9. ScreenOrientation = False
  10. canvas = image.new(size = (320, 240))
  11. img_num = 0
  12. while True:
  13. img_num = img_num + 1
  14. canvas.draw_image((image.open((str("/root/preset/img/dog/dog") + str(str(img_num) + str(".jpg"))))),0,0)
  15. time.sleep(1)
  16. if img_num == 30:
  17. img_num = 1
  18. if ScreenOrientation:
  19. canvasVER = canvas.crop(0,0,240,320)
  20. canvasVER = canvasVER.rotate(-90, adjust=1)
  21. display.show(canvasVER)
  22. else:
  23. canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
  24. display.show(canvas)