Android View to Image Capture getBitmapFromView(View view)

Here you can find the source of getBitmapFromView(View view)

Description

get Bitmap From View

Declaration

public static Bitmap getBitmapFromView(View view) 

Method Source Code

//package com.java2s;
import android.graphics.Bitmap;
import android.view.View;

public class Main {

    public static Bitmap getBitmapFromView(View view) {
        view.destroyDrawingCache();/* w  ww. jav a 2 s  .  c om*/
        view.measure(View.MeasureSpec.makeMeasureSpec(0,
                View.MeasureSpec.UNSPECIFIED), View.MeasureSpec
                .makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
        view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
        view.setDrawingCacheEnabled(true);
        Bitmap bitmap = view.getDrawingCache(true);
        return bitmap;
    }
}

Related

  1. shotScreen(View cv)
  2. view2Bitmap(View view)
  3. view2Bitmap(View view, boolean cache)
  4. loadBitmapFromView(View v)
  5. getBitmapFromView()
  6. view2Bitmap(View view)
  7. view2Bitmap(View view)