// 对指定视图进行截图
+ (UIImage *)screenShotView:(UIView *)view
{
UIImage *imageRet = nil;
if (view)
{
if(UIGraphicsBeginImageContextWithOptions != NULL)
{
UIGraphicsBeginImageContextWithOptions(view.frame.size, NO, 0.0);
}
else
{
UIGraphicsBeginImageContext(view.frame.size);
}
// 获取图像
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
imageRet = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
else
{
APP_ASSERT_STOP
}
return imageRet;
}