-(UIImage *)getImageFromView:(UIView *)theView
{
//UIGraphicsBeginImageContext(theView.bounds.size);
UIGraphicsBeginImageContextWithOptions(theView.bounds.size, YES, theView.layer.contentsScale);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}