2013-02-21 149 views
0

我必须在我的iPad应用程序中实现签名功能。我将签名转换成图像,之后我想获取该图像的坐标。我怎么能做到这一点帮助我。如何获取iOS应用程序中的图像坐标?

注意:我不是在谈论经纬度。我说的是像素坐标

+0

是如何接口的设计?是用户登录到“UIImageView”还是“UIView”?您对哪些坐标感兴趣,尊重容器视图还是* globals *坐标? – tkanzakic 2013-02-21 08:39:24

+0

用户正在绘制一个UIView – Mashhadi 2013-02-21 09:31:37

+0

好的,你最感兴趣的是哪个坐标? – tkanzakic 2013-02-21 09:32:30

回答

0

UIViewControllerUIResponder一个子类,这样你就可以实现的方法touchesBegan:withEvent:touchesMoved:withEvent:touchesEnded:withEvent:touchesCancelled:withEvent:检测“签名运动”。

例如使用方法-touchesMoved:withEvent:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    UITouch *touch = [touches anyObject]; 
    CGPoint currentPosition = [touch locationInView:self.view]; 
    NSLog(@"%@", NSStringFromCGPoint(currentPosition)); 
} 

欲了解更多信息检查UIResponder类的documentation