lineyka_chat.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:lineyka 作者: volodya-renderberg 项目源码 文件源码
def chat_add_img_to_line(self, button):
        rand  = hex(random.randint(0, 1000000000)).replace('0x', '')
        img_path = os.path.join(G.MW.db_chat.tmp_folder, ('tmp_image_' + rand + '.png')).replace('\\','/')

        clipboard = QtGui.QApplication.clipboard()
        img = clipboard.image()
        if img:
            img.save(img_path)
        else:
            G.MW.message('Cannot Image!', 2)
            return(False, 'Cannot Image!')

        button.setIcon(QtGui.QIcon(img_path))
        button.setIconSize(QtCore.QSize(100, 100))
        button.setText('')
        button.img_path = img_path

        return(True, 'Ok!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号