Here you can find the source of cutToScreen(Activity activity, Bitmap bitmap)
public static Bitmap cutToScreen(Activity activity, Bitmap bitmap)
//package com.java2s; import android.app.Activity; import android.graphics.Bitmap; import android.util.DisplayMetrics; public class Main { public static Bitmap cutToScreen(Activity activity, Bitmap bitmap) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); int intScreenWidth = dm.widthPixels; int intScreenHeight = dm.heightPixels; return Bitmap.createBitmap(bitmap, 0, 0, intScreenWidth, intScreenHeight);//from w w w . jav a 2 s .c o m } }