【问题标题】:How to take the screenshot( or image merge) for the 3D Transformed image?如何为 3D 转换图像截取(或图像合并)?
【发布时间】:2013-09-27 05:52:22
【问题描述】:

我想合并两个图像(查看截图 1),并更改为单个图像。但我无法合并 3D 变换图像。

如果我合并图像意味着它会变成原始大小(查看屏幕截图 2)。

我如何合并图像截取屏幕截图以获得 3D 转换图像视图。

我使用以下代码合并图像,

-(UIImage *)captureView:(UIImageView *)imageView
{
    //Merge the two images.
    UIGraphicsBeginImageContext(backgroundImageView.frame.size);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [imageView.layer renderInContext:ctx];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newImage;
}

【问题讨论】:

标签: iphone ios xcode uiimageview screenshot


【解决方案1】:

要截屏 3D 变换视图,您需要将 3D 变换视图转换为仿射变换然后截屏

【讨论】:

  • @Maddy Oven,能否给出3D Transform to Affine transform的过程或源代码。用于 2D 变换的仿射变换。
  • @Mani,quartz 核心框架有一个方法“CATransform3DGetAffineTransform”,它以 3D 变换为输入,返回等效的仿射变换。
  • @Maddy Oven,你太棒了......!这种方法“CATransform3DGetAffineTransform”工作得很好。非常感谢。
  • @Maddy Oven, rsImageView.layer.affineTransform = CATransform3DGetAffineTransform(rsImageView.layer.transform);但是我对图像进行了一些更改。这种转换改变了原始的转换图像。你能告诉我问题的原因吗?
  • @Mani:您能提供更多关于图像更改的详细信息吗?
猜你喜欢
  • 1970-01-01
  • 2021-07-09
  • 1970-01-01
  • 2020-01-23
  • 1970-01-01
  • 2013-06-16
  • 2013-03-28
  • 2019-09-29
  • 1970-01-01
相关资源
最近更新 更多