-1

我想截取一个图像视图的屏幕截图。并将该屏幕截图设置为另一个图像视图中的图像。我在这个过程中受到了打击。请帮我。

4

2 回答 2

5
UIGraphicsBeginImageContext(imageView.frame.size);
 [imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
 UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
 UIGraphicsEndImageContext();
yourSecondImageView.image = viewImage;
于 2012-08-28T14:23:07.283 回答
2

您应该获取您拥有的 UIImageView 的 UIImage 属性,并将其分配给您想要的其他图像视图。

于 2012-08-28T14:19:10.790 回答