Android开发中经常需要创建图片,而且从表现上来说,图片信息往往比文字信息更直观,更容易被人理解。所以创建图片的方法还是需要掌握的比较透彻,不应该像刚学Android开发一样——从别的地方复制过来再修改。
虽然我就是刚入门
目前接触到的都是通过Bitmap生成图片文件,所以创建Bitmap就成为了工作的第一布。Bitmap的创建往往是通过createBitmap方法来实现。createBitmap方法有多种,根据传入参数来选择所需。其中有:
//Returns an immutable bitmap from the specified subset of the source bitmap.
createBitmap(Bitmap source, int x, int y, int width, int height)
//Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
createBitmap(int[] colors, int width, int height, Bitmap.Config config)
//Returns an immutable bitmap from subset of the source bitmap, transformed by the optional matrix.
createBitmap(Bitmap source, int x, int y, int width, int height, Mat