Added support for taking snapshots of the screen, window or individual views

Summary:This adds a `takeSnapshot` method to UIManager that can be used to capture screenshots as an image.

The takeSnapshot method accepts either 'screen', 'window' or a view ref as an argument.

You can also specify the size, format and quality of the captured image.

I've added an example of capturing a screenshot at UIExplorer > Snapshot / Screenshot.
I've also added an example of sharing a screenshot to the UIExplorer > ActionSheetIOS demo.

Reviewed By: javache

Differential Revision: D2958351

fb-gh-sync-id: d2eb93fea3297ec5aaa312854dd6add724a7f4f8
shipit-source-id: d2eb93fea3297ec5aaa312854dd6add724a7f4f8
This commit is contained in:
Nick Lockwood
2016-02-23 02:26:11 -08:00
committed by facebook-github-bot-7
parent 0513d3abb5
commit ac12f98689
8 changed files with 288 additions and 5 deletions

View File

@@ -250,6 +250,7 @@ var apis = [
'../Libraries/StyleSheet/StyleSheet.js',
'../Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js',
'../Libraries/Components/ToastAndroid/ToastAndroid.android.js',
'../Libraries/Utilities/UIManager.js',
'../Libraries/Vibration/VibrationIOS.ios.js',
];