Android Canvas

来源:互联网 发布:java调用esb接口 编辑:程序博客网 时间:2024/04/19 03:33

绘图4大基本要素:(参考sdk Canvas.java的描述)

A Bitmap to hold the pixels

A Canvas to host the draw calls ( writing into the bitmap)

A Drawing prinitive, e.g. Rect, Path, Bitmap

A Paint to describe the colors and styles of the drawing


那么, canvas提供的绘图操作有哪些呢?

  1. 绘制BitmapdrawBitmapdrawPicture
  2. 绘制颜色:drawColordrawARGB
  3. 绘制基本形状:drawPointdrawLinedrawCircledrawArcdrawRectdrawRoundRect、drawPath
  4. 绘制剪切区:clipPathclipRectclipRegion
  5. 变换Canvassaverestoretranslatescalerotateconcat(Matrix matrix)setMatrix(Matrix matrix)
  6. 绘制顶点数据:drawVerticesdrawBitmapMesh 







0 0
原创粉丝点击