//scale爲縮放倍數,例如將View變爲原來的1/3大小,scale=0.3 public Bitmap viewToBitmap(View view,float scale){ int width = (int)(view.getWidth()*scale); int height = (int)(view.getHeight()*scale); Bitmap bitmap = Bitmap.createBitmap(width,height,Bitmap.config.AGRB_8888); Canvas canvas =new Canvas(bitmap); view.draw(canvas); return bitmap; }