def update_frame_image(self, frame_index: int): """ 刷新帧图象显示 :param frame_index: 帧索引 :return: None """ base64 = self._frame_base64_dict[frame_index] byte_arr = QByteArray(base64) img = QImage() img.loadFromData(QByteArray.fromBase64(byte_arr)) pixmap = QPixmap.fromImage(img) self.current_frame_item.setPixmap(pixmap) self.current_frame_index = frame_index
def GMakeIcon(base64): pixmap = QPixmap() pixmap.loadFromData(QByteArray.fromBase64(base64)) icon = QIcon(pixmap) return icon
def decode_image(text: str) -> QImage: encoded_bytes = QByteArray(text.encode('utf8')) image_bytes = QByteArray.fromBase64(encoded_bytes) image = QImage.fromData(image_bytes) return image