Basic Image Scaling and Rotating
We'll start our exploration of image editing and processing with learning how we can perform spatial transformations such as changing scale and rotating images.
Enter the Matrix
The Android API has a
Matrix class, which can be used when drawing on existing
Bitmap objects or creating a
Bitmap object from another
Bitmap object. This class allows us to apply a spatial transformation to an image. A transformation of this type would be rotating, cropping, scaling, or otherwise altering the coordinate space of the image.
Matrix class represents transformations with an array of nine numbers. In many cases, these can be generated by a formula that mathematically represents the transformation that should occur. For ...