Closed nonno closed 9 years ago
This https://developer.apple.com/library/ios/qa/qa1817/_index.html solve the problem.
(UIImage )snapshot:(UIView )view { UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0); [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
return image; }
I'm trying to write an application for applying a door on a environment, and I have to "attach" the door on the background. With canvas I have some problems so I decided to try with a screenshot, it works on Android but not on iOS. As you can see in the images, if I use your plugin the door is not deformed, but if I take a screenshot with iPad's physical buttons it works (the door is a img html). My question is: are there other ways in Objective-C for taking the screenshot? I searched on Google but I haven't found anything (and I'm not good with Objective-C). Thanks.