capture View as Bitmap - Android User Interface

Android examples for User Interface:View Bitmap

Description

capture View as Bitmap

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

import android.view.View;

public class Main {

    public static Bitmap captureView(View v) {
        v.setDrawingCacheEnabled(true);//from   w ww .j a va 2 s . c  om
        v.buildDrawingCache();
        return v.getDrawingCache();
    }
}

Related Tutorials