Canvas画图相关
Canvas画图
•画布基本功能的一个大概讲解
http://www.jb51.net/article/38861.htm
Canvas画布我的理解是它本身是无限大的,但是代码获得的宽和高是与手机屏幕的分辨率有关系的。画布平移后依然可以作画。
•关于画布平移的解释
Translate - Basically do what it says. Just translate the canvas using x,y. If you want to draw two objects and the one is just translation of the other e.g x2 = x1 + 50 for each point . You don’t have to make all your calculations again for the second object but you can just translate the canvas and draw again the same object. I hope this example will help you
平移API的解释
•What does it mean to “preconcat” a matrix in Android?
When working with matrices, the word concatenation refers to multiplication.
Since matrix multiplication is not commutative, there is a separate word for backwards multiplication.
Pre-concatenating a to b means setting a = b × a. (As opposed to a = a × b, which will give a different matrix)
•如果画图后希望保存到本地文件参考
http://stackoverflow.com/questions/18676311/android-app-how-to-save-a-bitmap-drawing-on-canvas-as-image-check-code
Canvas中的translate方法会影响坐标系。
注意:Canvas中的rotate方法会连同坐标系一起旋转。