- (UIImage *)createImageWithView:(UIView *)view {
CGSize s = view.bounds.size;
UIGraphicsBeginImageContextWithOptions(s, YES,[UIScreen mainScreen].scale);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage*image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}