I want to draw some texts using Quartz. Now the app draws , but I want it to show as \"0123456789\". Is there any way to show its normal orientation?
Here is my cod
In Quartz, the image will be upside down because its Y-Axis is inverted.
iPhone's Y axis goes positive from top to bottom i.e. origin is at top left while in Quartz and OpenGL, the co-ordinates are the same way as good old geometry i.e. origin at bottom left.
Here is some code for solving Quartz inversion problem:
CGContextRef ctx = UIGraphicsGetCurrentContext();
// Tanslate and scale upside-down to compensate for Quartz's inverted coordinate system
CGContextTranslateCTM(ctx, 0.0, rect.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
Here is an interesting post about it where the author says a team in Singapore gave up an iPhone project due to this inversion problem which they could not figure out: http://trandangkhoa.blogspot.com/2009/07/iphone-os-drawing-image-and-stupid.html