-(UIImage*)getScreenShotForView:(UIView*)view{
UIGraphicsBeginImageContext(view.bounds.size);[[[[UIApplicationsharedApplication]windows]objectAtIndex:0]drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];// Set To YESUIImage*image=UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();
returnimage;
}
截取window上的图片
网友评论