如何檢測我的繪製線是否與UIImageView相交?CGContext和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);
}
但我怎樣才能將CGContext翻譯成CGRect?我添加了一些代碼 – AmiiQo