[objective-c]UIViewをUIImageへ(Retina対応)

UIViewをUIImageへ(Retina対応)

-(UIImage*)getUIImageByUIView:(UIView*)view
{
    UIImage *screenImage;
    //UIGraphicsBeginImageContext(size);
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];
    screenImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return screenImage;
}