2013-02-25 7 views
0

이 코드를 사용하여 원을 그리기하고 내부의 모양을 그리기 :있는 UIImageView IOS

CGContextRef contextRef = UIGraphicsGetCurrentContext(); 
CGContextSetLineWidth(contextRef, 2.0); 
CGContextSetStrokeColorWithColor(contextRef, [color CGColor]); 
CGRect circlePoint = (CGRectMake(coordsFinal.x, coordsFinal.y, 50.0, 50.0)); 

CGContextStrokeEllipseInRect(contextRef, circlePoint); 

원이 내 UIWindow에 추가,하지만 난 그것과 같은 좌표를 유지하는 UIImageView에 추가 될 싶어한다 UIWindow이므로 좌표가 UIImageView 크기를 벗어나면 원은 보이지 않습니다. UIImageView에서 뷰에 대신 원을 그립니다.

답변

0

실제로 캔버스 (컨텍스트)에서 이미지를 가져 와서 이미지 뷰에 이미지를 설정해야합니다.

UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();