티스토리 뷰
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();
'모바일 프로그래밍' 카테고리의 다른 글
Android 6.0 Dangerous permissions (0) | 2016.04.26 |
---|---|
iOS 파일 읽기 쓰기 (0) | 2016.04.26 |
iOS ARC 프로젝트에서 non-ARC 소스 컴파일하기(-fno-objc-arc) (0) | 2016.04.26 |
iOS 개발시 스토리보드 제거하기 (0) | 2016.04.25 |
iOS 디바이스 모델 정보 얻기 (0) | 2016.04.25 |
- Total
- Today
- Yesterday