白桦的天空

第一次的心动,永远的心痛!
  首页  :: 新随笔  :: 联系 :: 管理

pygame镜像输出

Posted on 2023-06-14 16:37  白桦的天空  阅读(20)  评论(0编辑  收藏  举报
camera = PiCamera()
camera.resolution = (640, 480)
rawCapture = PiRGBArray(camera, size=(640, 480))

pygame.init()
lcdDisplay = pygame.display.set_mode((480,640))

for frame in camera.capture_continuous(rawCapture, format="rgb", 
    image = frame.array

    surf=pygame.surfarray.make_surface(image)
    lcdDisplay.blit(surf, (0,0))    

    pygame.display.update()
    pygame.display.flip()

    # clear the stream 
    rawCapture.truncate(0)

参考:https://www.coder.work/article/2388147