2012-04-14 3 views
-1

컬러링 앱을 개발하려고합니다. 나는 빈 캔버스로 시작하고 싶습니다. 그리고 터치를 사용하여 사용자가 색칠 할 때 나는 채색 된 이미지의 터치 한 부분 만 드러내고 싶습니다. 이것을 어떻게 성취합니까? 어떤 도움이 나에게 큰 도움이 될 것입니다.iOS 컬러링 투명 이미지

+0

보기 –

답변

0

이 내가 그것을 밖으로 시도를 havent하지만 SO 당신이 터치 이벤트에 대한

+0

감사에게 무엇을 잘 작동 질문에 발견 있지만

UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInView:drawImage]; UIGraphicsBeginImageContext(drawImage.frame.size); [drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)]; CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); CGContextSetLineWidth(UIGraphicsGetCurrentContext(), size); CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, a); CGContextBeginPath(UIGraphicsGetCurrentContext()); CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y); CGContextStrokePath(UIGraphicsGetCurrentContext()); drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 

을 시작 당신이 킥하는 데 도움이 될 것입니다 수 있습니다. 하지만 블렌딩 모드를 어떻게 통합합니까? 내가 물었을 때, 나는 그 색깔을 밝힐 필요가있다. – user1191140