我有这种方法可以在另一个图像上添加图像并获得合并结果
- (UIImage*) createImage{
UIImage *imageToShare = nil;
UIImageView* imageView = [[UIImageView alloc] initWithFrame:[self.view frame]];
imageView.image = currentImage;
UIImageView* subView = [[UIImageView alloc] initWithImage:imageToUse.image];
[imageView addSubview:subView];
UIGraphicsBeginImageContext(imageView.frame.size);
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
imageToShare = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[subView release];
[imageView release];
return imageToShare;
}
它工作正常,因为我的 imageToShare 没问题,但问题是“subView”是我可以旋转和捏合以进行缩放和移动的图像......然后当我执行此方法时 subView 返回到其原始位置......什么可以我是否将其保存在 imageView 上的状态位置?