UIImage *image = [UIImage imageNamed:@"花"];
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0);
[image drawAtPoint:CGPointZero];
NSString *str = @"花儿好美呀";
[str drawAtPoint:CGPointMake(20, 20) withAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:30], NSForegroundColorAttributeName: [UIColor redColor]}];
UIImage *logoImg = [UIImage imageNamed:@"logo"];
[logoImg drawAtPoint:CGPointMake(image.size.width - logoImg.size.width - 20 , image.size.height - logoImg.size.height - 20)];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image, NULL, NULL, NULL);
最终在相册中的图片
|