|
@@ -0,0 +1,33 @@
|
|
1
|
+import ViewShot,{ captureScreen,captureRef } from "react-native-view-shot";
|
|
2
|
+// import { captureScreen,captureRef } from "react-native-view-shot";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+class ExampleCaptureOnMountManually extends Component {
|
|
9
|
+ componentDidMount () {
|
|
10
|
+ this.refs.viewShot.capture().then(uri => {
|
|
11
|
+ console.log("do something with ", uri);
|
|
12
|
+ });
|
|
13
|
+ }
|
|
14
|
+ render() {
|
|
15
|
+ return (
|
|
16
|
+ <ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
|
|
17
|
+ <Text>...Something to rasterize...</Text>
|
|
18
|
+ </ViewShot>
|
|
19
|
+ );
|
|
20
|
+ }
|
|
21
|
+}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+export {ExampleCaptureOnMountManually}
|