一、概述
The Canvas class holds the "draw" calls. To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, Path, text, Bitmap), and a paint (to describe the colors and styles for the drawing).
Canvas类支持“draw”的调用,可以去绘制别的事物。你需要四种基本的组成成分:
(1)Bitmap(图像)
(2)Canvas(画布,主办描绘调用等,即等待绘制到bitmap中)
(3)primitive(绘制的原始事物(例如矩形、路径、文本、图像))
(4)paint(颜料,描述描绘的颜色和风格)
二、嵌套类
Nested Classes

enum
Canvas.EdgeType

enum
Canvas.VertexMode

三、常量
Constans

int
ALL_SAVE_FLAG
当restore()方法被调用时,恢复全部东西

int
CLIP_SAVE_FLAG
当restore()方法被调用时,恢复当前剪辑

int
CLIP_TO_LAYER_SAVE_FLAG
clip against the layer's bounds

剪辑对立层的边界

int
FULL_COLOR_LAYER_SAVE_FLAG
the layer needs to 8-bits per color component

int
HAS_ALPHA_LAYER_SAVE_FLAG
the layer needs to per-pixel alpha

int
MATRIX_SAVE_FLAG
restore the current matrix when restore() is called

当调用restore()方法时,恢复现有矩阵


四、公共构造函数
Public Constructors

Canvas()

Construct an empty raster canvas

Canvas(Bitmap bitmap)

Construct a canvas with the specified bitmap to draw into

Canvas(GL gl)

Construct a canvas with the specified gl context

更多相关文章

  1. Android之关于onSaveInstanceState和onRestoreInstanceState触发
  2. 移动数据流程
  3. Android实现ListView数据动态加载的方法
  4. Android(安卓)X86 获取不到ip的解决方法
  5. Android(安卓)图片OutOfMemory异常bitmap size exceeds VM budge
  6. Android中简单的日期格式化
  7. AndroidStudio旧模板使用方法
  8. Android(安卓)onMeasure(widthSpec, heightSpec)
  9. android 获取webView高度,设置webView高度

随机推荐

  1. GridView 加载并显示本地图片
  2. android使用同一个RecyclerView实现两种
  3. 【android错误收集】android.view.Inflat
  4. Android之SeekBar与RatingBar简单实例
  5. 解决问题:IllegalStateException - config
  6. Android最简单的基于FFmpeg的例子(四)---
  7. Android bundle传递数据简例
  8. Android(安卓)NDK学习笔记(一) 初识NDK
  9. Android 让按钮闪烁(点击的时候停止闪烁)
  10. android一种较为复杂的布局参考(xml文件)