https://kotlinlang.org logo
Title
v

v79

04/20/2021, 8:23 PM
Has JB wrapped Skia in some inaccessible way? I'm trying to convert a Skia Bitmap (for a Canvas) to black and white; all my searching returns methods like `
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
But there is no createBitmap function available. Nor pretty much any of the Android Bitmap functions.
k

Kirill Grouchnikov

04/20/2021, 8:40 PM
Not sure how you were planning to set the pixels, but one way that works is: 1) create a compose
ImageBitmap
, 2) call
asDesktopBitmap
on it that returns the Skija's
Bitmap
class, and then 3) call
Bitmap.installPixels
o

olonho

04/21/2021, 5:48 AM
Skia APIs available via org.jetbrains..skija package, no Android APIs exist for Desktop.