ios - Capture UIView without using renderInContext: -
I want to make video from my screen and for this I am going to capture the scene, but I do not want to Due to I think you do not want to use In this way, you will use a more efficient mechanism for iOS 7+, but at least versions will not crash at earlier versions. use renderincontex: I am now using
drawViewHierarchyInRect: , but it is limited to iOS 7 and my app also supports earlier versions of iOS I
drawViewHierarchyInRect: ?
UIGraphicsBeginImageContextWithOptions (self.bounds.size, NO, 0); [Self DrawHearActinator: After Self Screen BoundUpdates: Yes]; UIImage * image = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext ();
renderInContext Because it is less efficient, but for iOS versions before 7 years, you should use this technique (because if you try to use
drawerearyer in iOS versions before 7.0, The app will crash). Therefore, there is a presentation that uses
drawViewHierarchyInRect , but when it is available, but not
renderInContext when:
UIGraphicsBeginImageContextWithOptions (Self.bounds.size, no, 0.0); If: ([self answer: TSE: Selector: @Sillector (Draft HearerqiInternetect: Afterscreen Updates :)) {BUAL SUCCESS = [SELF DRAWHIAREARIKINRECTECT: Self updates: Screen updates: Yes]; NSAssert (success, @ "Draw WeihahriAreInteract Fails"); } And {{self. Layer RenderIncontext: UIGraphicsGetCurrentContext ()]; } UIImage * image = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext ();
Comments
Post a Comment