9
我想从网络摄像头加载图像显示在pygame的 为什么会出现这种不work.Pygame窗口打开,但没有显示我使用videocapture如何在pygame中显示图像?
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)
?
是你的形象命名1.JPG并在同一文件夹? – 2012-07-09 07:23:24
老兄,如果你看看你看到的代码saveSnapshot(str(In)+“。jpg”) – Rasovica 2012-07-10 14:27:34
你可以使用'pygame.camera'来拍照并取消对'VideoCapture'的依赖关系 – steffen 2016-03-30 12:40:33