Android Screenshort Take cutToScreen(Activity activity, Bitmap bitmap)

Here you can find the source of cutToScreen(Activity activity, Bitmap bitmap)

Description

cut To Screen

Declaration

public static Bitmap cutToScreen(Activity activity, Bitmap bitmap) 

Method Source Code

//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
    }
}

Related

  1. takeScreenShot(Activity activity)
  2. shot(Activity activity)
  3. snapShotWithoutStatusBar(Activity activity)
  4. snapShotWithStatusBar(Activity activity)