-(UIImage*)convertViewToImage:(UIView*)theView{
UIGraphicsBeginImageContextWithOptions( theView.frame.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}