So I have a UIWebView and there is an image showed inside it. The question is, is there any way for me to get the width, height, origin-x, origin-y of this image? I have added a UITapGestureRecognizer. What I want is that when I tap on the image, it gives me this information. How can I achieve this?
EDIT: Why doesn't this work:
NSString * widthJs = [NSString stringWithFormat:@"document.getElementById('imageid').clientHeight;"
];
NSString * heightJs = [NSString stringWithFormat:@"document.getElementById('imageid').clientWidth;"
];
NSString *width = [self stringByEvaluatingJavaScriptFromString:widthJs];
NSString *height = [self stringByEvaluatingJavaScriptFromString:heightJs];
NSLog(@"Coor height is %@ with coor width is %@", width, height);