CGSize size = CGSizeMake(width, height);
UIGraphicsBeginImageContext(size);
CGRect imageRect = CGRectMake(0, 0, width, height);
[img drawInRect:imageRect];
imgView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();