#!/usr/bin/env python
#version    :       2023.04.04
#language   :       en
from maix import display

from maix import image

from maix import camera
import time

camera.camera.config(size=(320,240))

ScreenOrientation = False



canvas = image.new(size = (320, 240))
img_num = 0
while True:
    img_num = img_num + 1
    canvas.draw_image((image.open((str("/root/preset/img/dog/dog") + str(str(img_num) + str(".jpg"))))),0,0)

    time.sleep(1)
    if img_num == 30:
        img_num = 1
    if ScreenOrientation:
        canvasVER = canvas.crop(0,0,240,320)
        canvasVER = canvasVER.rotate(-90, adjust=1)
        display.show(canvasVER)
    else:
        canvas.draw_image((image.open("/root/preset/img/exit_ff0000_24x24.png")).rotate(0, adjust=0),288,216,alpha=1)
        display.show(canvas)
