Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IOS UIImage Image upside down
- CGAffineTransform myTr = CGAffineTransformMake(1, 0, 0, -1, 0, backImage.size.height);
- CGContextConcatCTM(context, myTr);
- [backImage drawInRect:CGRectMake(cbx, -cby, backImage.size.width, backImage.size.height)];
- myTr = CGAffineTransformMake(1, 0, 0, -1, 0, backImage.size.height);
- CGContextConcatCTM(context, myTr);
- NSData *imageData = UIImageJPEGRepresentation(backImage, 0);
- UIGraphicsBeginImageContextWithOptions(size, isOpaque, 0);
- CGContextRef context = UIGraphicsGetCurrentContext();
- CGContextDrawImage(context, (CGRect){ {0,0}, origSize }, [origImage CGImage]);
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return image;
- NSData *imageData = UIImageJPEGRepresentation(backImage, 0);
- 1, 0, 0
- 0, 1, 0
- 0, 0, 1
- CGAffineTransform matrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
- matrix = CGAffineTransformTranslate(matrix, x, y);
- matrix = CGAffineTransformScale(matrix, -1, 1);
- matrix = CGAffineTransformScale(matrix, 1, -1);
- matrix = CGAffineTransformRotate(matrix, angle);
- matrix = CGAffineTransformScale(matrix, imageWidth/viewWidth, imageheight/viewHeight);
- CGContextConcatCTM(context, matrix);
Advertisement
Add Comment
Please, Sign In to add comment