我有 uiview ,我放大和缩小它
我将它与 pinchRecognizerMeasure 使用关联
pinchRecognizerMeasure = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(MeasureAndDraw:)];
[pinchRecognizerMeasure setDelegate:self];
[DrawLine addGestureRecognizer:pinchRecognizerMeasure];
[pinchRecognizerMeasure release];
MeasureAndDraw 的代码
// get position of touches, for example:
NSUInteger num_touches = [pinchRecognizerMeasure numberOfTouches];
// save locations to some instance variables, like `CGPoint location1, location2;`
if (num_touches >= 1) {
DrawLine.startPoint = [pinchRecognizerMeasure locationOfTouch:0 inView:DrawLine];
}
if (num_touches >= 2) {
DrawLine.endPoint = [pinchRecognizerMeasure locationOfTouch:1 inView:DrawLine];
}
startPoint , endPoint 是 CGPoint ,我想得到它的等效像素
我该怎么做是正确的
startPoint.X * DrawLine.contentScaleFactor 获取 pixl x 坐标或者我该怎么做
任何建议