How can I convert from resolution independent to pixel coordinates?
Early versions of the Zoomify Viewer made use of ‘resolution independent coordinates’ to specify and position hotspots within a zoomable image. This coordinate system represents an image using a span from a value of negative 1 to positive 1 both vertically and horizontally. Accordingly, the center of the image is represented as 0,0 while the far upper left corner would be represented as -1,-1. All recent versions (v3 and above) of the Zoomify Viewer make use of the simpler and more intuitive pixel coordinate representation. Using this approach, the position of a hotspot within a zoomable image is simply the number of pixels from the left side of the image and the number of pixels from the top of the image. The center of an image that is 1000 pixels wide and tall would therefore be 500,500 while the upper left corner would always be 0,0. It may be desirable under certain circumstances to convert between these coordinate systems. The functions below accomplish this task. Note that these