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()
评论列表
文章目录