-(UIImage *)convertViewToImage:(UIView*)view { UIGraphicsBeginImageContext(view.bounds.size);//context create a canvas to draw [view drawViewHierarchyInRect: view.bounds afterScreenUpdates:YES];//draws the view hierarchy into the current context UIImage *image = UIGraphicsGetImageFromCurrentImageContext();//Fetches UIImage from the current context UIGraphicsEndImageContext();// Context ends. return image; }
Showing posts with label screenshot. Show all posts
Showing posts with label screenshot. Show all posts
Tuesday, 4 August 2015
Convert UIView to UIImage. Taking screenshot programatically iOS.
Subscribe to:
Posts (Atom)