Android Bitmap to Drawable Convert from(Bitmap bitmap)

Here you can find the source of from(Bitmap bitmap)

Description

from

License

Apache License

Declaration

public static Drawable from(Bitmap bitmap) 

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 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();
    }
}

Related

  1. bitmap2Drawable(Bitmap bitmap)
  2. BitmapToDrawable(final Bitmap bitmap)
  3. bitmapToDrawable(Bitmap bitmap)
  4. bitmapToTransitionDrawable( Bitmap bitmap)
  5. geRoundDrawableFromUrl(String url, int pixels)