List of usage examples for android.graphics Bitmap getHeight
public final int getHeight()
From source file:Main.java
public static Bitmap resizeImageToHalf(Bitmap source) { int h = source.getHeight(); int w = source.getWidth(); return Bitmap.createBitmap(source, 0, 0, w, h); }
From source file:Main.java
public static InputStream bitmapToInputStream(Bitmap bitmap) { int size = bitmap.getHeight() * bitmap.getRowBytes(); ByteBuffer buffer = ByteBuffer.allocate(size); bitmap.copyPixelsToBuffer(buffer);/*from ww w.j a v a 2 s . com*/ return new ByteArrayInputStream(buffer.array()); }
From source file:Main.java
public static int getSize(Bitmap bm) { return bm.getRowBytes() * bm.getHeight(); }
From source file:Main.java
public static int sizeofBitmap(Bitmap value) { return value.getRowBytes() * value.getHeight(); }
From source file:Main.java
public static boolean isBitmapSquare(Bitmap bitmap) { return (bitmap.getWidth() == bitmap.getHeight()); }
From source file:Main.java
public static int getBitmapSize(Bitmap bitmap) { return bitmap.getRowBytes() * bitmap.getHeight() / 1024; }
From source file:Main.java
public static final int getBitmapByteCount(Bitmap bitmap) { return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:Main.java
public static int getByteCount(Bitmap bitmap) { return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:Main.java
/** * Get the hashcode for a bitmap./* w ww . j a v a 2 s. c o m*/ */ private static String hashBitmap(Bitmap bmp) { int[] allpixels = new int[bmp.getHeight() * bmp.getWidth()]; bmp.getPixels(allpixels, 0, bmp.getWidth(), 0, 0, bmp.getWidth(), bmp.getHeight()); return Integer.toHexString(Arrays.hashCode(allpixels)); }
From source file:Main.java
public static int getBitmapSize(Bitmap bitmap) { return bitmap.getRowBytes() * bitmap.getHeight(); }