Ejemplo n.º 1
0
def snipmatch():
    print(window.state)
    if (not is_src_img_selected):
        mb.showwarning('Warning', 'Please Select Source Image First')
        return False
    match_filename = 'temp_images/match.jpg'
    window.iconify()
    #os.system(r'snipping_tool.exe match.jpg')
    #window.state('zoomed')
    sn.Capture(match_filename)
    if (match_filename == ''):
        mb.showwarning('Warning', 'No To be Match Image Selected')
        return False

# Change label contents
    label_file_explorer.configure(text="Please Wait....", fg="blue")
    image1 = Image.open(match_filename)
    # The (450, 350) is (height, width)
    image1 = image1.resize((image_resize_width, image_resize_height),
                           Image.ANTIALIAS)
    imgtk1 = ImageTk.PhotoImage(image=image1)
    lmain_match.imgtk = imgtk1
    lmain_match.configure(image=imgtk1)
    matchimages(src_image, match_filename)
    window.deiconify()
Ejemplo n.º 2
0
def snipsrc():
    print(window.state)
    window.iconify()
    src_filename = 'source.jpg'
    sn.Capture(src_filename)
    #os.system(r'snipping_tool.exe source.jpg')
    image = Image.open(src_filename)
    # The (450, 350) is (height, width)
    image = image.resize((150, 150), Image.ANTIALIAS)
    imgtk = ImageTk.PhotoImage(image=image)
    lmain_src.imgtk = imgtk
    lmain_src.configure(image=imgtk)
    global is_src_img_selected
    is_src_img_selected = True
    global src_image
    src_image = src_filename
    window.deiconify()