Bitmap drawingCache = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c =new Canvas(drawingCache);
c.drawColor(Color.WHITE);
/** 如果不设置canvas画布为白色,则生成透明 */
allContent.layout(0, 0, view.getWidth(), view.getHeight());
allContent.draw(c);
savePicture(drawingCache,name+".jpg");//保存到本地
iv.setImageBitmap(drawingCache);//设置到imageview上