0
我正在尋找一種方法,我如何將TransitionDrawable轉換爲Drawable或To位圖以便能夠保存圖像。如何將可繪製的轉換轉換爲可繪製或位圖
我一直在尋找一段時間,我嘗試了很多方法,沒有線索。
這裏的代碼是我曾嘗試:
TransitionDrawable drawable = (TransitionDrawable) profil.getDrawable();
Drawable drawalb = drawable.mutate();
final Bitmap bitmap = ((BitmapDrawable) drawalb).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] image = stream.toByteArray();