我正在尝试在TKInter中显示图片。我在FLEA3点灰相机中使用Pycapture库。我可以拍照,但是当我尝试在GUI中显示时,显示错误,指出Pycapture没有属性“ read”
导入PyCapture2 从sys导入出口 从PIL导入ImageTk 导入PIL.Image 从进口睡眠 从tkinter导入*
enableEmbeddedTimestamp(camera,True)
camera.startCapture()
img = ImageTk.PhotoImage(PIL.Image.open(grabImages(camera, 1)))
showImage = Label(imageContainer, image=img)
showImage.pack(side=BOTTOM, expand="yes")
imageLabel.create_image(20, 20, anchor="n", image=img)
camera.stopCapture()