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

OK、kCGBlendModeClear を kCGBlendModeNormal に置き換えて解決します

于 2013-09-22T08:44:32.670 に答える