로 이미지를 그립니다하지만 내가 함께 시도했다 CGContextConcatCTM
내가 <code>CGAffineTransform</code>에있는 UIImage을 그리려는 CGAffineTransform 및 CGContextDrawImage
잘못 출력을 제공 코드 아래 :
CGAffineTransform t = CGAffineTransformMake(1.67822, -1.38952, 1.38952, 1.67822, 278.684, 209.129); // transformation of uiimageview
UIGraphicsBeginImageContext(CGSizeMake(1024, 768));
CGContextRef imageContext = UIGraphicsGetCurrentContext();
CGContextDrawImage(imageContext, dragView.frame, dragView.image.CGImage);
CGContextConcatCTM(imageContext, t);
NSLog(@"\n%@\n%@", NSStringFromCGAffineTransform(t),NSStringFromCGAffineTransform(CGContextGetCTM(imageContext)));
출력 :
[1.67822, -1.38952, 1.38952, 1.67822, 278.684, 209.129] // imageview transformation
[1.67822, 1.38952, 1.38952, -1.67822, 278.684, 558.871] // drawn image transformation
CGAffineTransform CGAffineTransformMake (
CGFloat a,
CGFloat b,
CGFloat c,
CGFloat d,
CGFloat tx,
CGFloat ty
);
매개 변수 b, d 및 ty가 변경되었습니다. 어떻게 해결할 수 있습니까?
처음에 그 값에 어떻게 도달 했습니까? –
또한 이미지가 거꾸로 표시 되는가 (그렇지 않으면 잘못 된 방향으로 돌아가는가) 아니면 걱정스러운 로그 출력입니까? –
네, 그냥 로그 출력 – Nikkie