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
Post a Comment