`
buerkai
  • 浏览: 166911 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Android之Canvas

 
阅读更多
一、概述
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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics