1
from tkinter import *
from PIL import ImageTk
from PIL import Image
import cv2
def on3_button():
    url = 'my url'
    while True:
        imgResp = urllib.request.urlopen(url)
        imgNp = np.array(bytearray(imgResp.read()), dtype=np.uint8)
        img = cv2.imdecode(imgNp, -1)

  
        cv2.imshow('test', img)
        if ord('q') == cv2.waitKey(10):
             break

Second code

root.geometry("1920x1080+0+0") 
background = ImageTk.PhotoImage(Image.open("D:\Telegrambotphotos\Ard.jpg")) 
rootBack = Label(root, image=background) 
rootBack.place(x=0, y=0, width=1920, height=1080) 
photoSUp = ImageTk.PhotoImage(Image.open("E:\\python\\control interface\\illis\\mid-01.png")) 
rootMid = Label(root, image=photoSUp) 
rootMid.place(x=1495, y=513) 
Button(rootMid, image = photoSUp,).pack(side = LEFT)
Nick ODell
  • 15,465
  • 3
  • 32
  • 66
  • Please add your "second code" to the question in a code block by using the `Edit` link below your question, then pressing the `{ }` button in the headerbar of the editor, then paste your code in. Finally, press the `Save edits` button to submit your edit. – TheEagle Aug 22 '21 at 12:59
  • Please also take the time to read [the tour](https://stackoverflow.com/tour) and [How to Ask](https://stackoverflow.com/help/asking) – TheEagle Aug 22 '21 at 13:00
  • Does this answer your question? [OpenCV load video from url](https://stackoverflow.com/questions/50185654/opencv-load-video-from-url) – ironmann350 Aug 22 '21 at 13:12

0 Answers0