android-Canvas
来源:互联网 发布:证件照拍照软件 编辑:程序博客网 时间:2024/05/02 01:23
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类控制着绘图。为了绘图,你需要是个基本的组成部分。
1. 一个Bitmap来控制每个像素点
2. 一个Canvas来控制绘图(绘制到bitmap)
3. 一个绘制的图形(直角,线,文本,bitmap)
4. 一个画笔(描绘要画的颜色和风格)
个人理解如下。
Bitmap 实际对应着的是实际设备的界面,是实际的像素点。
Canvas 对应着的是一个虚拟设备界面。
有4中的这只笔在2中这个画布上绘制3这样的图形,最后显示到1这个屏幕上。
public void drawColor(int color)
Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode.
用指定的颜色填充整个canvas的bitmap。
public void drawArc()
画弧线
public void drawARGB(int a, int r, int g, int b)
用A透明度,RGB三原色填充canvas
public void drawBitmap()
画bitmap
public void drawCircle()
画圆
public void drawLine()
画线
public void drawVertices()
Draw the array of vertices, interpreted as triangles (based on mode).
- Android Canvas
- Android Canvas
- android canvas
- Android Canvas
- Android:Canvas
- Android Canvas
- android canvas
- Android Canvas
- android-Canvas
- Android Canvas
- android-Canvas
- Android Canvas
- Android Canvas
- android canvas
- android canvas
- 【canvas】Android Canvas绘图详解
- Android canvas上画图时改变canvas
- Android Bitmap和Canvas
- HDFS只支持文件append操作, 而依赖HDFS的HBase如何完成增删改查功能
- Java多线程学习笔记
- Shell基础-Bash变量-位置参数变量
- JavaScript闭包作用域与this
- Android视图状态及重绘流程分析,带你一步步深入了解View(三)
- android-Canvas
- android gridview网格视图
- tomcat在ubuntu下启动成功但不显示欢迎页面,也启动不了struts2项目
- JUnit4 中@AfterClass @BeforeClass @after @before的区别对比
- <算法> 最长公共子序列
- Java垃圾搜集器
- generally, we use libvirt(1)
- Android自定义View的实现方法,带你一步步深入了解View(四)
- 做优秀产品经理的七个小窍门