Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.graphics.BitmapFactory; public class Main { public static BitmapFactory.Options getSize(Context c, int resId) { android.graphics.BitmapFactory.Options o = new android.graphics.BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeResource(c.getResources(), resId, o); return o; } }