1

I want to take screenshot of specific composable function on Jetpack Compose. How can I do this? Please, anyone help me

Brother DT
  • 11
  • 1
  • wish to be result like use native https://stackoverflow.com/questions/43817116/take-a-full-screenshot-of-scrollview-android/43817149 – Brother DT Nov 22 '21 at 07:27

1 Answers1

0

There is currently no support for this. Compose applications have only one view (window.decorView). You can use traditional methods to get a screenshot of the root view but that is for the entire screen. If you know the location of the composable compoenent on the screen that you want the screenshot of, you will have to apply clipping to the bitmap that you get from the whole screen.

Johann
  • 27,536
  • 39
  • 165
  • 279