Back to project page base-android-utils.
The source code is released under:
Apache License
If you think the Android project base-android-utils listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * @Title: DrawableUtil.java /*from w w w .j a va2s . co m*/ * @Package me.pc.mobile.helper.util * @Description: TODO * @author SilentKnight || happychinapc[at]gmail[dot]com * @date 2014 2014?11?28? ????11:39:29 * @version V1.0.0 */ package me.pc.mobile.helper.v14.util; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; /** * @ClassName: DrawableUtil * @Description: TODO * @author SilentKnight || happychinapc@gmail.com * @date 2014?11?28? ????11:39:29 * */ public final class BitDrawableUtil { private BitDrawableUtil() { } public static Drawable from(Bitmap bitmap) { BitmapDrawable bitDrawable = new BitmapDrawable(bitmap); return bitDrawable; } public static Bitmap from(Drawable drawable) { BitmapDrawable bitDrawable = (BitmapDrawable) drawable; return bitDrawable.getBitmap(); } }