1.官方API文档中对save()方法的解释:

public class Canvas {    /**     * Saves the current matrix and clip onto a private stack. Subsequent     * calls to translate,scale,rotate,skew,concat or clip Rect,clipPath     * will all operate as usual, but when the balancing call to restore()     * is made, those calls will be forgotten, and the settings that existed     * before the save() will be reinstated.     */    /**     * 保存当前的矩阵和剪裁到一个私有的堆栈,其实矩阵和剪裁就是当前Canvas的状态State
接着调用位置,缩放,选择,倾斜,concat或者剪辑矩形,剪辑区域等将被正常操作,但是
当restore()被调用,恢复时,这些操作都将被放弃,并且刚才调用save()之前被保存的状态将被重新恢复。
     */    public native int save();}
 
public class Canvas {    /**     * This call balances a previous call to save(), and is used to remove all     * modifications to the matrix/clip state since the last save call. It is     * an error to call restore() more times than save() was called.     */    /**     * 移除自上次保存操作后所做的修改,恢复到之前的状态,因为是堆栈实现,所以pull操作不能不等于push操作,
save()和restore()应该成对使用,否则恢复的状态就很有可能是错误的     */    public native void restore();}

更多相关文章

  1. android 简单的画图操作
  2. ()Android中的Activity创建与周期
  3. android获取/更改gps和WIFI状态
  4. 使用 Jetpack Security 在 Android(安卓)上进行数据加密
  5. android内存管理等
  6. Android利用Dom对XML进行增删改查操作详解
  7. Android数据库操作的简单封装
  8. Android(安卓)EditText remove focus 只要頁面中有用到EditText
  9. 谷歌全新操作系统Pigweed曝光,Android(安卓)11偷跑

随机推荐

  1. Android初学心得和一些资料下载
  2. ExtJS在Android中的显示效果
  3. Android中ViewFlipper的使用
  4. Android高手进阶教程(十五)---Android中
  5. Android——腾讯X5使用记录
  6. FFmpeg在Android上的移植优化步骤 .
  7. Android(安卓)开发中常见的Eclipse排版设
  8. 【Android】在Android上使用OrmLite数据
  9. 两种特殊TabHost实现
  10. android make 命令使用