{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

AndroidImageHelpersKt

public final class AndroidImageHelpersKt


Summary

Public methods

static final @NonNull ImageBitmap

Captures the underlying semantics node's surface into bitmap.

Public methods

captureToImage

@RequiresApi
public static final @NonNull ImageBitmap captureToImage(@NonNull SemanticsNodeInteraction receiver)

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.

Throws
kotlin.IllegalArgumentException

if we attempt to capture a bitmap of a dialog before API 28.