I wanted to rotate the contents of the CGContextRef with -90 degrees. I found some code but it is not working correctly.
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;
Anyone help me please.