zoom feature

greetings. im trying to implemen a zoom feature on a picture, at the moment im using scale when zooming, wich doesnt give a natural zoom experience for the user, is there any easy way to implement a zoom that zooms from from the center of screen instead of center of image as the scale does atm.

solved it by storing the x and y values of the image and then multiplying by the scale afterwards.
though it had a problem as i’ve set the center to a fixed value wich i solved by subtracting the center value before storing and then adding them after the multiplication

solved it by storing the x and y values of the image and then multiplying by the scale afterwards.
though it had a problem as i’ve set the center to a fixed value wich i solved by subtracting the center value before storing and then adding them after the multiplication