First create an identity matrix.
1, 0, 0 0, 1, 0 0, 0, 1 CGAffineTransform matrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
Move position to draw ...
matrix = CGAffineTransformTranslate(matrix, x, y);
The flip matrix is horizontal.
matrix = CGAffineTransformScale(matrix, -1, 1);
Flip matrix is vertical.
matrix = CGAffineTransformScale(matrix, 1, -1);
Rotate matrix
matrix = CGAffineTransformRotate(matrix, angle);
Set UIImage to UIView.
matrix = CGAffineTransformScale(matrix, imageWidth/viewWidth, imageheight/viewHeight);
Run matrix in context.
CGContextConcatCTM(context, matrix);
Draw a picture.
[backImage drawAtPoint:CGPointMake(0, 0)]
:)