【发布时间】:2013-10-01 13:49:42
【问题描述】:
如何检测我绘制的线是否与我拖动的 UIImageView 相交?
不知何故,互联网并不是很有帮助。但是提前谢谢!
- (void)drawRect:(CGRect)rect {
context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
CGContextMoveToPoint(context, 384, 435);
CGContextAddLineToPoint(context, 494, 402);
CGContextAddLineToPoint(context, 537, 419);
CGContextAddLineToPoint(context, 544, 450);
CGContextAddLineToPoint(context, 494, 488);
NSLog(@"%@", NSStringFromCGRect(recting));
CGContextStrokePath(context);
}
【问题讨论】:
标签: ios uiimageview cgcontext