get View Bitmap - Android User Interface

Android examples for User Interface:View Bitmap

Description

get View Bitmap

Demo Code


//package com.java2s;

import android.graphics.*;

import android.view.View;

public class Main {
    public static Bitmap getViewBitmap(View view) {
        View rootView = view.getRootView();
        view.invalidate();/*ww  w .j a va  2  s  . com*/
        rootView.setDrawingCacheEnabled(true);
        return rootView.getDrawingCache();
    }
}

Related Tutorials