File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Improve export/import snapshot from screen on iOS
2+
3+ The from screen form of export/import snapshot has been changed
4+ to use a different API on iOS7+, which allows a greater variety
5+ of native layers to be captured.
Original file line number Diff line number Diff line change @@ -617,8 +617,19 @@ static void MCScreenDCDoSnapshot(void *p_env)
617617 -[window bounds ].size .height * [[window layer ] anchorPoint ].y );
618618
619619 // Render the layer hierarchy to the current context
620- [[window layer ] renderInContext: t_img_context];
621-
620+ if ([window respondsToSelector: @selector (drawViewHierarchyInRect:afterScreenUpdates: )])
621+ {
622+ // This method is supported in iOS7+ and will capture many
623+ // native view's content.
624+ UIGraphicsPushContext (t_img_context);
625+ [window drawViewHierarchyInRect: [window bounds ] afterScreenUpdates: YES ];
626+ UIGraphicsPopContext ();
627+ }
628+ else
629+ {
630+ [[window layer ] renderInContext: t_img_context];
631+ }
632+
622633 // Restore the context
623634 CGContextRestoreGState (t_img_context);
624635 }
You can’t perform that action at this time.
0 commit comments