public static Bitmap createBitmap(Bitmap src) 從原位圖src復制出一個新的位圖,和原始位圖相同
public static Bitmap createBitmap(int[] colors, int width, int height, Bitmap.Config config) 這個函數根據顏色數組來創建位圖,注意:顏色數組的長度>=width*height 此函數創建位圖的過程可以簡單概括為為:更加width和height創建空位圖,然后用指定的顏色數組colors來從左到右從上至下一次填充顏色。config是一個枚舉,可以用它來指定位圖“質量”。
public static Bitmap createBitmap(int[] colors, int offset, int stride, int width, int height, Bitmap.Config config) 此方法與2類似,但我還不明白offset和stride的作用。
public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height, Matrix m, boolean filter) 從原始位圖剪切圖像,這是一種高級的方式。可以用Matrix(矩陣)來實現旋轉等高級方式截圖 參數說明: Bitmap source:要從中截圖的原始位圖 int x:起始x坐標 int y:起始y坐標 int width:要截的圖的寬度 int height:要截的圖的寬度 Bitmap.Config config:一個枚舉類型的配置,可以定義截到的新位圖的質量 返回值:返回一個剪切好的Bitmap
public static Bitmap createBitmap(int width, int height, Bitmap.Config config) 根據參數創建新位圖
public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height)