Vladimir Tagakov
07/23/2025, 8:47 PMGraphicsLayer#toImageBitmap()
api as described here. Everything works except shadows are not being captured no matter what composable in the hierarchy I'm trying to capture. Is there any way to capture shadows as well?yschimke
07/23/2025, 9:25 PMVladimir Tagakov
07/23/2025, 9:26 PMtoImageBitmap
uses hardware acceleration and shadows also drawn using graphicsLayer
and, I assume, are hardware acceleratedSergey Y.
07/24/2025, 9:08 AMSergey Y.
07/24/2025, 9:10 AMSergey Y.
07/24/2025, 9:15 AMVladimir Tagakov
07/24/2025, 3:20 PMSergey Y.
07/24/2025, 3:39 PMLong Tran
07/24/2025, 4:13 PMVladimir Tagakov
07/24/2025, 4:14 PMSergey Y.
07/24/2025, 4:41 PMLong Tran
07/24/2025, 4:49 PMyschimke
07/24/2025, 5:36 PMZach Klippenstein (he/him) [MOD]
07/24/2025, 5:41 PMZach Klippenstein (he/him) [MOD]
07/24/2025, 5:46 PMGraphicsLayer
capture too. If you have access to the ScrollState
then you don't need that of course.Vladimir Tagakov
07/24/2025, 9:48 PMprivate fun Modifier.staticShadow(
elevation: Dp,
shape: Shape,
yOffset: Dp = elevation/3,
basePadding: Dp = elevation/2
): Modifier = this
.padding(
start = basePadding,
end = basePadding,
top = basePadding - yOffset,
bottom = basePadding + yOffset,
)
.dropShadow(shape) {
radius = elevation.toPx()
offset = Offset(0f, yOffset.toPx())
alpha = .25f
}