graphicscontext

iOS: what's the fastest, most performant way to make a screenshot programmatically?

自古美人都是妖i 提交于 2019-11-26 16:55:37
in my iPad app, I'd like to make a screenshot of a UIView taking a big part of the screen. Unfortunately, the subviews are pretty deeply nested, so it takes to long to make the screenshot and animate a page curling afterwards. Is there a faster way than the "usual" one? UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); If possible, I'd like to avoid caching or restructuring my view. I've found a better method that uses the snapshot API

iOS: what's the fastest, most performant way to make a screenshot programmatically?

℡╲_俬逩灬. 提交于 2019-11-26 06:04:26
问题 in my iPad app, I\'d like to make a screenshot of a UIView taking a big part of the screen. Unfortunately, the subviews are pretty deeply nested, so it takes to long to make the screenshot and animate a page curling afterwards. Is there a faster way than the \"usual\" one? UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); If possible, I\