-1

画像効果のプログラムを作成しましたが、下のコードを使用してフォトショップなどの効果を追加しようとすると、画像にメモリが割り当てられないため、結果の画像が表示されません。

UIImage *bottomImage = originalImage;
UIImage *upperImage = originalImage;

UIGraphicsBeginImageContextWithOptions(sizeR, YES, imageBeforeEffect.scale);
[bottomImage drawInRect:CGRectMake(0.0, 0.0, sizeR.width, sizeR.height)];
 [upperImage drawInRect:CGRectMake(0.0, 0.0, sizeR.width, sizeR.height) blendMode:kCGBlendModeDarken alpha:1.0];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
4

1 に答える 1

1

sizeRにフレームがあるかどうかを確認してください...ブレークポイントを入れて確認してください。フレームがない場合、は機能しUIGraphicsBeginImageContextWithOptionsません。

于 2012-07-27T11:00:43.017 に答える