Example usage for android.graphics.drawable BitmapDrawable getBitmap

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

Introduction

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

Prototype

public final Bitmap getBitmap() 

Source Link

Document

Returns the bitmap used by this drawable to render.

Usage

From source file:Main.java

public static int getBitmapSize(BitmapDrawable drawable) {
    return getBitmapSize(drawable.getBitmap());
}

From source file:Main.java

private static Bitmap drawableToBitamp(Drawable drawable) {
    BitmapDrawable bd = (BitmapDrawable) drawable;
    return bd.getBitmap();
}

From source file:Main.java

public static Bitmap drawable2Bitmap(Drawable drawable) {
    BitmapDrawable bd = (BitmapDrawable) drawable;
    return bd.getBitmap();
}

From source file:Main.java

public static Bitmap drawable2Bitmap(Drawable d) {
    BitmapDrawable bd = (BitmapDrawable) d;
    Bitmap bm = bd.getBitmap();
    return bm;
}

From source file:Main.java

public static Bitmap drawable2Bitmap(Context context, Drawable d) {
    BitmapDrawable bd = (BitmapDrawable) d;
    Bitmap bm = bd.getBitmap();
    return bm;/*from   w  ww .  j ava2 s  . c o m*/
}

From source file:Main.java

public static Bitmap convertDrawable2Bitmap(Drawable d) {

    BitmapDrawable bd = (BitmapDrawable) d;

    Bitmap bm = bd.getBitmap();
    return bm;
}

From source file:Main.java

/**
 * //  w w  w.  ja v a2s  .c  o m
 * @param drawable
 * @return bitmap
 */
public static Bitmap drawableToBitmap2(Drawable drawable) {
    BitmapDrawable bd = (BitmapDrawable) drawable;
    return bd.getBitmap();
}

From source file:Main.java

/**
 * Determine if the image orientation is landscape or portrait.
 *
 * @param drawable//from w w  w. j a v a  2s.  c o m
 * @return IMAGE_ORIENTATION_PORTRAIT or IMAGE_ORIENTATION_LANDSCAPE.
 */
public static String isLandscapeOrPortrait(BitmapDrawable drawable) {
    int width = drawable.getBitmap().getWidth();
    int height = drawable.getBitmap().getHeight();
    if (width > height) {
        return IMAGE_ORIENTATION_LANDSCAPE;
    } else {
        return IMAGE_ORIENTATION_PORTRAIT;
    }
}

From source file:Main.java

public static Bitmap drawable2Bitmap(Drawable drawable) {
    BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
    return bitmapDrawable.getBitmap();
}

From source file:Main.java

public static Bitmap drawableToBitmapByBD(Drawable drawable) {
    BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
    return bitmapDrawable.getBitmap();
}