我想从网络摄像头加载图像并在Pygame上显示,我正在使用VideoCapture。
from VideoCapture import Device
import pygame
import time
In=1
pygame.init()
w = 640
h = 480
size=(w,h)
screen = pygame.display.set_mode(size)
while True:
cam = Device()
cam.saveSnapshot(str(In)+".jpg")
img=pygame.image.load(In)
screen.blit(img,(0,0))
In=int(In)+1
In=str(In)
为什么这个代码无法正常工作,Pygame窗口打开但没有显示任何内容?
pygame.camera
来拍照,并消除对VideoCapture
的依赖。 - steffen