Assume I have an Image with dimensions 800 pixels width by 500 pixels height. Assume I scale this Image with some algorithm to dimensions 100 pixels width by 900 pixels height and assume I got a mouse click at x:50, y:35 with X:0, y:0 as pixel in the top-left corner. How to calculate, where the mouse click would be in the original Image, if it wasn't scaled?
Is there an easy formula do calculate this?
Thanks in advance!
TRY THIS:
Mouse X-Coord in the original image = Mouse-X-Coord / (new_width / original_width);
Mouse Y-Coord in the original image = Mouse-Y-Coord / (new_height / original_height)