In the development encountered some of the matrix of the place, now this summary, easy to consult later.
Single-finger drag and two-finger scaling for images in ImageView by setting the matrix on ImageView
Core approach:
Imageview.setimagematrix (matrix);
So our focus is to operate a matrix.
The main use of this service is to use the matrix to achieve scaling (scale) and displacement (Translate)
Android picture rotation, scaling, displacement, tilt, symmetry complete example (i)--imageview.setimagematrix (matrix) and matrix
There's nothing new here. The core approach is still Imageview.setimagematrix (matrix);
or the main operation of a matrix. Then set the modified matrix to ImageView.
Here is a custom ImageView inherited from the imageview of the system.
So every time you call the Setimagematrix (matrix) on the custom ImageView, it calls the OnDraw () method
Android picture rotation, scaling, displacement, tilt, symmetry complete example (ii)--bitmap.createbitmap () and matrix
in this example, the main use of Bitmap.createbitmap (...) and the Matrix realizes the rotation, scaling, displacement, and tilt of the image.
the role of the mode and Mimageview.setimagematrix (matrix); is the same.
So:
The rotation, scaling, displacement, tilt and symmetry of the image are achieved using the matrix! Just say the objects are different.
(1) using Imageview.setimagematrix (matrix) to act on ImageView.
Because ImageView shows the picture, The matrix effect can be reflected in the picture
(2) using bitmap.createbitmap (...) Directly acting on the newly generated bitmap
Set,pre,post Call Order of matrix
The main point here is to understand the Matrix's set,pre,post invocation order.
such as sometimes confusing why the pre or post does not work, see this should be understandable
Create a reflection of bitmap
The matrix is also used here.
In the future will be added to the induction.