这是我的功能,它是在 iOS 中合并 2 张图片的已知方法:
- (UIImage * ) mergeSubjectToPlancheAvantGrabcut: (UIImage *)planche
{
NSLog(@"mergeSubjectToPlancheAvantGrabcut START");
UIGraphicsBeginImageContextWithOptions(CGSizeMake(planche.size.width , planche.size.height), NO, 1);
[planche drawAtPoint: CGPointMake(0,0)];
[self.imageViewSubject.image drawAtPoint: CGPointMake(0 , 0)
blendMode: kCGBlendModeClear // you can play with this
alpha: 1]; // 0 - 1
NSLog(@"mergeSubjectToPlancheAvantGrabcut END");
UIImage *answer = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return answer;
}
正如我所说,它适用于 ios6 但不适用于 ios 7 :(
任何想法 ?
谢谢