Android examples for Graphics:Bitmap Size
Get Bitmap's height
//package com.java2s; import android.content.res.Resources; import android.graphics.BitmapFactory; public class Main { /** Get Bitmap's height **/ public static int getBitmapOfHeight(Resources res, int id) { try {/*from ww w . j ava 2 s .c om*/ BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(res, id, options); return options.outHeight; } catch (Exception e) { return 0; } } }