How to flip coordinates when drawing in context?
问题 I create a context from an UIImage, and then I draw into it with CGContextDrawImage(bitmapContext, CGRectMake(0, 0, originalImage.size.width, originalImage.size.height), oImageRef); the image appears upside-down due to the flipped coordinate system in quartz. How can I fix that? 回答1: You should be able to transform the context using something similar to the following: CGContextSaveGState(bitmapContext); CGContextTranslateCTM(bitmapContext, 0.0f, originalImage.size.height); CGContextScaleCTM