小编Bes*_*est的帖子

19
推荐指数
5
解决办法
3万
查看次数

如何在kotlin中将imageview转换为bytearray

如何将 imageview 转换为 bytearray kotlin android

在 Java 中

Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap();
ByteArrayOutputStream stream=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 90, stream);
byte[] image=stream.toByteArray();

return image
Run Code Online (Sandbox Code Playgroud)

android imageview kotlin

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×2

kotlin ×2

fragment ×1

imageview ×1