(byte_array) # 将 QByteArray 转换为 QImage这些示例展示了如何在 QPixmap、QImage 和 QByteArray 之间进行转换。...()height = image.height()array = np.zeros([height, width, 4], dtype=np.uint8) # 创建一个空的 numpy 数组for y...RGBA 值 array[y, x] = rgba # 将 RGBA 值存入 numpy 数组numpy 数组转换为 QImage:array = np.zeros([100, 100..., 4], dtype=np.uint8) # 创建一个 numpy 数组array[:, :, 0] = 255 # 将红色通道设置为 255image = QImage(array.data,...100, 100, QImage.Format_RGBA8888) # 将 numpy 数组转换为 QImage这些示例展示了如何在 QImage 和 numpy 数组之间进行转换。