http://www.cnblogs.com/gongcb/archive/2012/08/11/2633648.html
/**截屏操作 * * 把图片保存到SD卡 */ private void ScreenShot(View v,String fileName){ View view = v.getRootView(); view.setDrawingCacheEnabled(true); Bitmap bitmap = view.getDrawingCache(); FileOutputStream fos = null; File dirFile = new File(DIRPATH); if(!dirFile.exists()){ dirFile.mkdir(); } try { fos = new FileOutputStream(new File(DIRPATH + FILENAME)); if (null != fos) { bitmap.compress(Bitmap.CompressFormat.PNG, 90, fos); fos.flush(); fos.close(); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }