Example #1
0
 def DoOpenFile(self):
     open_dlg = wx.FileDialog(self,message='Choose a file', style=wx.OPEN|wx.CHANGE_DIR)
     if open_dlg.ShowModal() == wx.ID_OK:
         self.picpath=open_dlg.GetPath()
         self.picName = open_dlg.GetFilename()
         try:
             self.im = pylab.array(Image.open(self.picpath).convert('L'))
             self.displayImage()
         except IOError, error:
             dlg = wx.MessageDialog(self, 'Error opening file\n' + str(error))
             dlg.ShowModal()
Example #2
0
 def btnResetEvent(self, event):
     """重置图片,撤销所有修改"""
     self.im = pylab.array(Image.open(self.picpath).convert('L'))
     self.displayImage()