Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

rn_vshot.native.js 857B

123456789101112131415161718192021222324252627282930313233343536
  1. import ViewShot,{ captureScreen,captureRef } from "react-native-view-shot";
  2. // import { captureScreen,captureRef } from "react-native-view-shot";
  3. import React, { PureComponent,Component} from 'react';
  4. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  5. class ExampleCaptureOnMountManually extends Component {
  6. componentDidMount () {
  7. // captureScreen
  8. // this.refs.viewShot.capture().then(uri => {
  9. this.refs.captureScreen.capture().then(uri => {
  10. console.log("do something with ", uri);
  11. });
  12. }
  13. render() {
  14. // <ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
  15. return (
  16. <ViewShot ref="captureScreen" options={{ format: "jpg", quality: 0.9 }}>
  17. <Text>...Something to rasterize...</Text>
  18. </ViewShot>
  19. );
  20. }
  21. }
  22. export {ExampleCaptureOnMountManually}