Join Slack
Powered by
How can I capture a Surface as a png or jpeg file ...
# compose
m
Mehdi Haghgoo
02/23/2023, 6:36 AM
How can I capture a Surface as a png or jpeg file in Compose?
r
romainguy
02/23/2023, 7:04 AM
The easiest way is to use PixelCopy (
https://developer.android.com/reference/android/view/PixelCopy
) to capture a Bitmap and then use Bitmap.compress() to generate a PNG or JPEG
m
Mehdi Haghgoo
02/23/2023, 8:26 AM
What are the not-easy ways?
l
Landry Norris
02/23/2023, 2:35 PM
The skiko targets have ImageComposeScene for this, which is interestingly missing in Android.
m
Mehdi Haghgoo
02/23/2023, 2:41 PM
Is skiko iOS specific?
l
Landry Norris
02/23/2023, 2:42 PM
Skiko supports desktop jvm, and (experimental) iOS and macos.
Landry Norris
02/23/2023, 2:43 PM
It's basically what every non-android compose uses. From my understanding, Android uses the bitmap/canvas libraries instead.
5
Views
Open in Slack
Previous
Next