2012-01-21 4 views
0

나는 포토샵에서와 같이 "브러시"를 어떻게 바꿀지 궁금해하고있는 작은 드로잉 앱으로 놀고 있습니다. 나는 원이 아닌 브러쉬로 커스텀 이미지를 사용하고 싶다. 어떻게해야합니까? 당신은 브러시 스트로크를 구성하는 선분을 따라 여러 지점에서, 적절한 혼합으로, 브러시 이미지를 그릴 필요가UIGraphics로 그리기

UIGraphicsBeginImageContext(self.view.frame.size); 

    [drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 

    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); 

    CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeCopy); 

    CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.0, 0.0, 0.0, 1.0); 


    CGContextSetLineWidth(UIGraphicsGetCurrentContext(), currentSize); 

    CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); 

    CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); 

    CGContextStrokePath(UIGraphicsGetCurrentContext()); 

    CGContextFlush(UIGraphicsGetCurrentContext()); 

    drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); 

    UIGraphicsEndImageContext(); 

답변

0

: 여기

내가 현재 그리는 방법이다.