You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @blueparkyanadoocorp, I'm not familiar with an example for Android that does this, but one thing you can try to see if it works with your current implementation is to use the Canvas renderers (instead of Skia or Rive). See our docs on choosing a renderer.
RiveAnimationView is a TextureView so you can't get a capture by normal view's way. Instead you can use TextureView.getBitmap() which is more convenient.
Hello
How do I Capture RiveView in Android?
Here is my code.
[Compose Button]
@composable
fun MyRoomShareView(
modifier: Modifier = Modifier,
uiState: MyRoomUiState,
onShare: (Uri) -> Unit = {},
) {
val context = LocalContext.current
val coroutineScope = rememberCoroutineScope()
Box(
modifier = modifier
.padding(top = 8.dp, start = 8.dp, end = 8.dp, bottom = 32.dp)
) {
Column(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
) {
}
@composable
fun screenshotableComposable(content: @composable () -> Unit): () -> Bitmap {
val context = LocalContext.current
val composeView = remember { ComposeView(context = context) }
fun captureBitmap(): Bitmap = composeView.drawToBitmap()
AndroidView(
factory = {
composeView.apply {
setContent {
content()
}
}
},
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight() // Make sure to set unbounded true to draw beyond screen area
)
return ::captureBitmap
}
Thank you
The text was updated successfully, but these errors were encountered: