python b64 圖片處理

保存b64圖片 dic['image']爲圖片數據

         with open('imgcode.png', 'wb') as f:
                    f.write(base64.b64decode(dic['image']))
                    #open('imgcode.png')
                    return True

Pyqt5 窗口顯示 圖片

            pimg = base64.b64decode(self.dics['image'])

            png = QPixmap(100, 100)
            png.loadFromData(pimg)
            self.lable = QLable()
            self.lable.setPixmap(png)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章