我有一个放置在特定变换的视图。我想截取这个视图的截图,但是在渲染之后它没有考虑到变换的价值。转换并截取视图?
我查看
dragView = [[DragbleView alloc] initWithFrame:CGRectMake(10, 200, 200, 90)];
dragView.contentView = textField;
dragView.transform = CGAffineTransformMakeRotation (-0.663247);
[self.view addSubview:dragView];
我的截图代码
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [UIScreen mainScreen].scale);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
问题After taking screenshot it always comes horizontal neglecting the value of transform
请显示更多代码。你的屏幕截图代码中的“视图”是什么?如何使用图像? – gabbler 2014-12-07 11:46:40
https://github.com/SunnyShah407/DragImageView ..请检查这个项目 – 2014-12-07 12:21:23
因此,你希望视图的变换停留在截图图像中吗? – gabbler 2014-12-07 12:27:56