验证码:如何可以投GlideBitmapDrawable到reciprocaly BitmapDrawable
imageView = (ImageView) findViewById(R.id.avatar);
Bitmap photo = ((GlideBitmapDrawable)imageView.getDrawable().getCurrent()).getBitmap();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.PNG,100,bos);
byte[] bArray = bos.toByteArray();
这个错误:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable
感谢您的帮助:)
做你试试这个职位 - > https://stackoverflow.com/questions/37701061/android-graphics-drawable-transitiondrawable-cannot-be-cast-to-com- bumptech-glid – slymnozdmrc
实际上我用Bitmap.createScaledBitmap(bmp,x,y,bool)将图像加载到ImageView中,现在我想用Glide(GlideBitmapDrawable)检索它以存储在数据库中 –
这部分是我想要的并且往回 –