Code: Select all
self.tempImage = self.tempImage.resize((int(self.videoWidth),int(self.videoHeight)),Image.Resampling.LANCZOS)
self.photo = ImageTk.PhotoImage(image = self.tempImage)
self.VideoCanvas[i].create_image(0, 0, image = self.photo, anchor = tk.NW)
if len(self.BBox) == 0:
self.BBox.append(self.VideoCanvas[i].create_rectangle(self.xVar.get() - 5,self.yVar.get()-5,self.xVar.get()+5,self.yVar.get()+5))
else:
self.VideoCanvas[i].coords(self.BBox[0],self.xVar.get() - 5,self.yVar.get()-5,self.xVar.get()+5,self.yVar.get()+5)