'Why I'm Getting negative x value when I configure the tk()
def openpic(self):
self.filename = tkinter.filedialog.askopenfilename()
self.openpicture = ImageTk.PhotoImage(Image.open(self.filename))
self._canvas.itemconfig(self.object, image=self.openpicture)
self.pictureValue = self._canvas.bbox(self.object)
self._canvas.config(width = self.pictureValue[2], height= self.pictureValue[3])
self.picturewidth = self.pictureValue[2] - self.pictureValue[0]
self.pictureheight = self.pictureValue[3] - self.pictureValue[1]
posx = str(int(self._top.winfo_screenwidth()/2) - int((self.picturewidth + 100)/2))
posy = str(int(self._top.winfo_screenheight()/2) - int((self.pictureheight/2)))
framex = str(str(self.picturewidth + 100) + "x" + str(self.pictureheight) + "+" + posx + "+" + posy)
print(framex)
self._picture_Frame.configure(str(framex))
if I print framex the result will be 712x816+412+24 but in runtime the 712 become -712, please help me!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|