Document directory
- Something you don't understand
The Bitmap. createBitmap function has six overload methods.
BitmapCutRefer to Methods 4 and 6 for reload, and Method 6 for reload is relatively simple.
- Public static Bitmap createBitmap (Bitmap src)
Copy a new bitmap from the original bitmap src, which is the same as the original bitmap.
- Public static Bitmap createBitmap (int [] colors, int width,
Int height, Bitmap. Config
Config)
This function creates a bitmap based on the color array,Note: The length of the color array> = width * height
This function can be used to create a bitmap in a simple way: Create a blank map with a higher width and height, and then fill the color from left to right with the specified color array colors. Config is an enumeration that can be used to specify the bitmap "quality ".
- Public static Bitmap createBitmap (int [] colors, int offset,
Int stride, int width, int height, Bitmap. Config
Config)
This method is similar to 2, but I still don't understand the role of offset and stride.
- Public static Bitmap createBitmap (Bitmap source, int x,
Int y, int width, int height, Matrix m, boolean
Filter)
Cutting an image from the original bitmap is an advanced method. Advanced rotation methods such as Matrix can be used.
Parameter description:
Bitmap source: original Bitmap from
Int x: Start x coordinate
Int y: Start y coordinate
Int width: the width of the graph to be captured.
Int height: the width of the graph to be captured.
Bitmap. Config config: An enumeration configuration that defines the quality of the captured new Bitmap.
Returned value: returns a cut Bitmap.
- Public static Bitmap createBitmap (int width, int height, Bitmap. Config
Config)
Create a new bitmap based on parameters
- Public static Bitmap createBitmap (Bitmap source, int x,
Int y, int width, int height)For a simple image cutting method, refer to the above 4.
Something you don't understand
- How Bitmap. Config controls Bitmap Creation
- In Bitmap. createBitmap's overloaded version 4Offset, stride, and filterWhat is the role