Function

captureToImage

Captures the underlying semantics node's surface into bitmap.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

captureToImage

Android
@RequiresApi(Build.VERSION_CODES.O)
fun SemanticsNodeInteraction.captureToImage(): ImageBitmap

Captures the underlying semantics node's surface into bitmap. This can be used to capture nodes in a normal composable, a dialog if API >=28 and in a Popup. Note that the mechanism used to capture the bitmap from a Popup is not the same as from a normal composable, since a PopUp is in a different window.