0
-90도를 사용하여 CGContextRef의 내용을 회전하고 싶습니다. 일부 코드를 발견했지만 제대로 작동하지 않습니다.CGContextRef 회전이 작동하지 않습니다.
CGContextRef tempColorRef = CGBitmapContextCreate(NULL, width, height, bitsPerComponent,
bytesPerRow, colorspace,
kCGImageAlphaPremultipliedLast);
CGImageRef colorImageRef = CGBitmapContextCreateImage(colorContextRef);
CGContextTranslateCTM(tempLayerRef, width/2, height/2);
CGContextRotateCTM(tempLayerRef, DegreesToRadians(-90));
CGContextScaleCTM(tempColorRef, 1.0, -1.0);
CGContextDrawImage(tempColorRef, CGRectMake(-width/2, -height/2, width, height), colorImageRef);
CGImageRelease(colorImageRef);
colorContextRef = tempColorRef;
누구나 도와주세요.
"올바르게 작동하지 않음"이란 무엇을 의미합니까? 당신은 비강 악마 또는 무엇을 경험합니까? –
내용물이 사라졌습니다. –
수학 부분이 엉망이되어 틀림없이 문맥을 그릴 것이라고 확신합니다. 스케일 부분을 제거하면 어떨까요? –