title: Screen Shot in React Native (Android)
body: <p>I am using the <a href="https://github.com/gre/react-native-view-shot" rel="nofollow noreferrer">React-Native-View-Shot Library</a> to take a screenshot of the whole screen.</p>
  
  <p>It is mentioned in the documentation that the method captureScreen():</p>
  
  <blockquote>
    <p>captureScreen() will capture the contents of the currently displayed screen as a native hardware screenshot. It does not require a ref input, as it does not work at the view level. This means that ScrollViews will not be captured in their entirety - only the portions currently visible to the user.</p>
  </blockquote>
  
  <p>However, the screenshot is not capturing any components other than the camera preview. All the components used are claimed to be supported as in the interoperability table of the documentation.</p>
  
  <p>Code:</p>
  
  <pre class="lang-jsx prettyprint-override"><code>takeScreenshot() {
      captureScreen({
          format: "jpg",
          quality: 0.8
      }).then(
          uri =&gt; { savePath = uri; console.log("Image saved to", uri); CameraRoll.saveToCameraRoll(uri); ToastAndroid.show(uri + "", ToastAndroid.SHORT); },
          error =&gt; console.error("Oops, snapshot failed", error)
          );
  }
  
  render() {
      return (
          &lt;View style={styles.container}&gt;
              &lt;Text style={{backgroundColor:"white"}}&gt;Hello World&lt;/Text&gt;
              &lt;RNCamera style={styles.preview}
                  ref={ref =&gt; {
                      this.camera = ref;
                  }}
                  type={RNCamera.Constants.Type.back}
                  flashMode={RNCamera.Constants.FlashMode.on}
                  permissionDialogTitle={'Permission to use camera'}
                  permissionDialogMessage={'We need your permission to use your camera phone'}&gt;
              &lt;/RNCamera&gt;
              &lt;Button title="Capture" onPress={()=&gt;this.takeScreenshot()}/&gt;
          &lt;/View&gt;
      )
  }
  </code></pre>
  
  <p>The RNCamera is the camera component from <a href="https://github.com/react-native-community/react-native-camera" rel="nofollow noreferrer">react-native-camera</a></p>
  
  <p><a href="https://i.stack.imgur.com/FjSEF.png" rel="nofollow noreferrer">Expected Result</a></p>
  
  <p><a href="https://i.stack.imgur.com/8GFnd.jpg" rel="nofollow noreferrer">Obtained Result</a></p>
  
  <p><a href="https://stackoverflow.com/questions/47975792/how-can-i-take-a-screenshot-of-camera-screen-using-a-button-in-react-native?rq=1">Referred Question</a> had no answer as well</p>
  
  <p>What could be the issue? Why are the components covered with camera preview too?</p>