2017-06-16 86 views
0

即时尝试使tkinter窗口显示图像 但是当我在tkinter窗口中打开图像时 - 图像的一部分显示在窗口的任务栏下方, 因为的,我不能老是查看该图像的底部部分如何在窗口的任务栏上方设置tkiner窗口

示出具有标签的照片IM(其画面的一部分 - 共享程序,每一秒另一图像显示Tkinter的窗口上)

**照片的大小是所有屏幕的大小

即时通讯不确定我的代码是真的有必要,我的问题就是如何设置Tkinter的窗口的任务栏上面.. :)

def ShowImage(): 
    global root 
    root = Tkinter.Tk() 
    try: 
     label = Tkinter.Label(root) 
     label.pack() 
     img = None 
     tkimg = [None] # This, or something like it, is necessary because if you do not keep a reference to PhotoImage instances, they get garbage collected. 

     delay = 2 # in milliseconds 
     def loopCapture(): 
      #print "capturing" 
      global im 
      while im==None: 
        continue 
      img = im 
      tkimg[0] = ImageTk.PhotoImage(img) 
      label.config(image=tkimg[0]) 
      root.update_idletasks() 
      root.after(delay, loopCapture) 

     loopCapture() 
+0

即时通讯不知道我的代码是否真的有必要,我的问题是如何在windows的任务栏上方设置tkinter .. :) –

回答

0

我建议你在Tkinter的阅读有关toplevel。从根目录添加顶级,并且它将在屏幕上的所有其他顶部。

希望这会帮助你,Yahli。