- 从路径读取
pixmap = QPixmap('./image.jpg')
self.videolabel.setPixmap(pixmap)
- 直接读取图片
success, frame = self.cap.read()
cover = cv2.cvtColor(cover, cv2.COLOR_RGB2BGR)
temp_image = QImage(frame.data, cover.shape[1], cover.shape[0], 3*cover.shape[1],QImage.Format_RGB888) #bytesPerLine=3*width
pixmap = QPixmap.fromImage(frame)
self.videolabel.setPixmap(pixmap)