- (UIImage *)convertImageWithView:(UIView *)convertView
{
CGFloat scale = [UIScreen mainScreen].scale;
UIGraphicsBeginImageContextWithOptions(convertView.bounds.size, NO, scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
[convertView.layer renderInContext:context];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGFloat x = convertView.frame.origin.x * scale;
CGFloat y = convertView.frame.origin.y * scale;
CGFloat w = convertView.frame.size.width * scale;
CGFloat h = convertView.frame.size.height * scale;
CGRect dianRect = CGRectMake(x, y, w, h);
CGImageRef sourceImageRef = [image CGImage];
CGImageRef newImageRef = CGImageCreateWithImageInRect(sourceImageRef, dianRect);
UIImage * newImage = [UIImage imageWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
return newImage;
}