Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.BitmapFactory; import android.util.DisplayMetrics; public class Main { public static BitmapFactory.Options getBitmapOptions(DisplayMetrics mDisplayMetrics) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inDensity = DisplayMetrics.DENSITY_DEFAULT; options.inTargetDensity = mDisplayMetrics.densityDpi; return options; } }