zoom while drawing rectangle in tkinter

I am new to Python Tkinter. My idea of using tkinter is to do annotation by zooming in and out of a image. Tkinter canvas zoom + move/pan I started my first course of action based on the baove mentioned stackoverflow question and answers.

But the problem i face is if i zoom in and drag to the second part of image i am not able to locate the bounding box with help of mouse events and if i draw in one point the rectangle is generated in other point of the first portion of image.

Can anyone guide me to solve this issue in tkinter with zoom in and out drawing a rectangle?