Java tutorial
//package com.java2s; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap LOAD_IMAGE(Resources res, int scaling, int id) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = false; options.inSampleSize = scaling; return BitmapFactory.decodeResource(res, id, options); } }