Here you can find the source of from(Bitmap bitmap)
public static Drawable from(Bitmap bitmap)
//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 Drawable from(Bitmap bitmap) { BitmapDrawable bitDrawable = new BitmapDrawable(bitmap); return bitDrawable; }//from w w w. j a v a 2s.c om public static Bitmap from(Drawable drawable) { BitmapDrawable bitDrawable = (BitmapDrawable) drawable; return bitDrawable.getBitmap(); } }