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 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 ();    

I think you do not want to use 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 ();   

In this way, you will use a more efficient mechanism for iOS 7+, but at least versions will not crash at earlier versions.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -