0

这是我的功能,它是在 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 :(

任何想法 ?

谢谢

4

1 回答 1

1

好的,我通过用 kCGBlendModeNormal 替换 kCGBlendModeClear 来解决它

于 2013-09-22T08:44:32.670 回答