uiimageview - How to find the pixel location in original image in ios -


i have image size 480x360 , displaying in uiimageview frame (0, 0, 320, 568) aspectfill.

when touch image view, location says (150,120). how can map location in original image (480x360) format?

thanks

you calculate proportions , apply them touch location point.

cgfloat _x = imageview.image.size.width / imageview.frame.size.width; cgfloat _y = imageview.image.size.height / imageview.frame.size.height;  //assuming p - cgpoint received touch event cgpoint locationinimageview = cgpointmake(p.x * _x, p.y * _y); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -