I'm using tkinter
to display an image, pad or zoom it and finally get position of a pixel respect to the original image.
In order to zoom and pad the image I have used the class provided by this answer. Both zooming and padding work perfetcly, but I'm not able to get the correct x, y. This is the part of the code useful to understand the zoom/pad:
imagetk = ImageTk.PhotoImage(image.resize((int(x2 - x1), int(y2 - y1)), self.__filter))
imageid = self.canvas.create_image(max(box_canvas[0], box_img_int[0]),
max(box_canvas[1], box_img_int[1]),
anchor='nw', image=imagetk)
self.canvas.lower(imageid)
Among the methods, I would like to add a new method that has been called by:
canvas1.canvas.bind("<Button 3>", canvas1.getpoints)
whit which I would like to compute the coordinate respect to the original image.
Any suggestions?