Code example for View

Methods: buildDrawingCachedestroyDrawingCachegetDrawingCache

0
	 * @return a bitmap of the given view 
	 *  
	 */ 
 
	private Bitmap getBitmapOfView(final View view){
		view.destroyDrawingCache();
		view.buildDrawingCache(false);
		Bitmap orig = view.getDrawingCache();
		Bitmap.Config config = null;
 
		if(orig != null) {
			config = orig.getConfig();
		} 
 
		if(config == null) {
			config = Bitmap.Config.ARGB_8888;
		} 
		Bitmap b = orig.copy(config, false);
		view.destroyDrawingCache();
		return b; 
	} 
 
	/** 
	 * Returns a proper filename depending on if name is given or not. 
Stop searching for code, let great code find you!  Add Codota to your java IDE