I'm a bit confused by the coordinate system differences between UIKit and Core Graphics. The Apple documentation notes that UIKit uses an ULO (Upper Left Origin) while Core Graphics uses a LLO (Lower Left Origin).
However, as noted in a post about coordinate systems, it is noted that UIKit
helpfully flips the coordinate system before calling -drawRect:
When I draw a rectangle at (0,0), it is indeed in the upper left hand corner, so things do seem flipped. However, when I draw an image using CGContextDrawImage(), it is still flipped. I understand I can just use drawAtPoint() to avoid the upside down image, but I am just curious about the coordinate system: if it's flipped by UIKit, why is the image still upside down if it is drawn into the flipped context? Also, is there any way to get an unflipped coordinate system? That is, is there a way to create a CGContext without going through the UIKit?
Thanks!