Как преобразовать 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