2013-02-21 98 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

相關問題