main_GUI.py 文件源码

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

项目:image-copy-move-detection 作者: rahmatnazali 项目源码 文件源码
def onFilePicker(self):

        ftypes = [('PNG Files', '*.png'), ('All files', '*')]
        dlg = tkFileDialog.Open(self, initialdir='../testcase_image/', filetypes = ftypes)
        choosedFile = dlg.show()

        if choosedFile != '':
            print choosedFile
            self.imageName = str(choosedFile).split("/")[-1]
            self.imagePath = str(choosedFile).replace(self.imageName, '')

            self.textBoxFile.config(state='normal')
            self.textBoxFile.delete('1.0', END)
            self.textBoxFile.insert(END, choosedFile)
            self.textBoxFile.config(state='disabled')

            newImageLeft = Image.open(choosedFile)
            imageLeftLabel = ImageTk.PhotoImage(newImageLeft)
            self.labelLeft = Label(self, image=imageLeftLabel)
            self.labelLeft.image = imageLeftLabel
            self.labelLeft.place(x=5, y=100)

            imageRight = Image.open("resource/empty.png")
            imageRightLabel = ImageTk.PhotoImage(imageRight)
            self.labelRight = Label(self, image=imageRightLabel)
            self.labelRight.image = imageRightLabel
            self.labelRight.place(x=525, y=100)

        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号