Android Drawable to Bitmap Convert drawableToBitmap(Drawable drawable)

Here you can find the source of drawableToBitmap(Drawable drawable)

Description

drawable To Bitmap

License

Apache License

Declaration

public static Bitmap drawableToBitmap(Drawable drawable) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

public class Main {
    public static Bitmap drawableToBitmap(Drawable drawable) {
        BitmapDrawable bd = (BitmapDrawable) drawable;
        Bitmap bitmap = bd.getBitmap();//from   ww  w  .jav a 2 s . com
        return bitmap;
    }
}

Related

  1. getBitmap(Resources resources, int drawableResourceId)
  2. getBitmapDrawable(Context context, int resId)
  3. from(Drawable drawable)
  4. drawableToBitmap(Drawable drawable)
  5. drawableToBitmap(Drawable drawable)
  6. drawableToBitmap(Drawable drawable)
  7. drawableToBitmap(Drawable drawable)
  8. drawableToBitmap(Drawable drawable)
  9. convertToBitmap(final Drawable drawable)