Example usage for android.graphics.drawable BitmapDrawable BitmapDrawable

List of usage examples for android.graphics.drawable BitmapDrawable BitmapDrawable

Introduction

In this page you can find the example usage for android.graphics.drawable BitmapDrawable BitmapDrawable.

Prototype

@Deprecated
public BitmapDrawable(java.io.InputStream is) 

Source Link

Document

Create a drawable by decoding a bitmap from the given input stream.

Usage

From source file:Main.java

public static Drawable bitmapToDrawableByBD(Bitmap bitmap) {
    Drawable drawable = new BitmapDrawable(bitmap);
    return drawable;
}

From source file:Main.java

public static Drawable bitmapToDrawable(Bitmap bitmap) {
    Drawable drawable = new BitmapDrawable(bitmap);
    return drawable;
}

From source file:Main.java

public static Drawable bitmapToDrawableByBD(Bitmap bitmap) {
    @SuppressWarnings("deprecation")
    Drawable drawable = new BitmapDrawable(bitmap);
    return drawable;
}

From source file:Main.java

/**
 * //  w w w . j  av  a 2  s  .c  o  m
 * @param bmp
 * @return
 */
// @SuppressWarnings("deprecation")
public final static BitmapDrawable getBitmapDrawable(Bitmap bmp) {
    return new BitmapDrawable(bmp);
}

From source file:Main.java

public static StateListDrawable bgColorDrawableSelector(Bitmap nomal, Bitmap focus) {

    BitmapDrawable nomalBitmap = new BitmapDrawable(nomal);
    BitmapDrawable focusBitmap = new BitmapDrawable(focus);
    StateListDrawable selector = new StateListDrawable();
    selector.addState(new int[] { android.R.attr.state_pressed }, focusBitmap);
    selector.addState(new int[] { android.R.attr.state_selected }, focusBitmap);
    selector.addState(new int[] { android.R.attr.state_focused }, focusBitmap);
    selector.addState(new int[] {}, nomalBitmap);
    return selector;
}

From source file:Main.java

/**
 * @param bitmap/*from  www.  j a  v a  2 s.  co  m*/
 * @return
 */
public static Drawable bitmapToDrawable(Bitmap bitmap) {
    BitmapDrawable drawable = new BitmapDrawable(bitmap);
    return drawable;
}

From source file:Main.java

public static Drawable bitmap2Drawable(Bitmap bm) {
    if (bm == null) {
        return null;
    }/*from  www. j  av  a  2s.  c om*/
    BitmapDrawable bd = new BitmapDrawable(bm);
    bd.setTargetDensity(bm.getDensity());
    return new BitmapDrawable(bm);
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static Drawable bitmapToDrawable(Bitmap bitmap) {
    if (null == bitmap)
        return null;
    return new BitmapDrawable(bitmap);
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static Drawable bitmap2Drawable(Bitmap bm) {
    if (bm == null) {
        return null;
    }//ww w.j  ava2  s .  c o m
    return new BitmapDrawable(bm);
}

From source file:Main.java

/**
 * bitmap -> Drawable//from  ww  w  .  j  a va2  s.com
 * 
 * @param bm
 * @return
 */
public static BitmapDrawable BitmapToDrawable(Bitmap bitmap) {
    BitmapDrawable bd = new BitmapDrawable(bitmap);
    return bd;
}