wxgraphics.py 文件源码

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

项目:cebl 作者: idfah 项目源码 文件源码
def saveFile(self):
        self.refresh()

        saveDialog = wx.FileDialog(self, message='Save Image',
                wildcard='Portable Network Graphics (*.png)|*.png|All Files|*',
                style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)

        try:
            if saveDialog.ShowModal() != wx.ID_CANCEL:
                img = self.drawingBuffer.ConvertToImage()
                img.SaveFile(saveDialog.GetPath(), wx.BITMAP_TYPE_PNG)

        except Exception as e:
            wx.LogError('Save failed!')
            raise

        finally:
            saveDialog.Destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号