Как преобразовать ImageView в Bytearray в KotlinAndroid

Форум для тех, кто программирует под Android
Anonymous
Как преобразовать ImageView в Bytearray в Kotlin

Сообщение Anonymous »

Как преобразовать ImageView в Bytearray Kotlin Android < /p>

в java < /p>

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

return image


Подробнее здесь: https://stackoverflow.com/questions/466 ... -in-kotlin

Вернуться в «Android»