我想做的是以下。用户可以使用 iPhone 相机拍照。拍照后,他们将在所拍照片的顶部放置另一张图像。放置在顶部的图像也应旋转 25°。除了旋转之外,我还需要将顶部的图像降低到拍摄照片下方一点。你可以在这里看到我的意思。
我有以下。
-(UIImage *)drawImage:(UIImage*)profileImage withBadge:(UIImage *)badge
{
UIGraphicsBeginImageContextWithOptions(profileImage.size, NO, 0.0f);
[profileImage drawInRect:CGRectMake(0, 0, profileImage.size.width, profileImage.size.height)];
[badge drawInRect:CGRectMake(profileImage.size.width - badge.size.width, profileImage.size.height - badge.size.height,badge.size.width,badge.size.height)];
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultImage;
}
-(void)captureImage {
UIImage *img1 = [cropFilter imageFromCurrentlyProcessedOutput];
UIImage *img2 = [UIImage imageNamed:@"genkonstage.jpg"];
UIImage *img = [self drawImage:img1 withBadge:img2];
//UIImage *img = [cropFilter imageFromCurrentlyProcessedOutput];
[stillCamera.inputCamera unlockForConfiguration];
[stillCamera stopCameraCapture];
[self removeAllTargets];
staticPicture = [[GPUImagePicture alloc] initWithImage:img
smoothlyScaleOutput:YES];
任何人都可以帮助我吗?