小智 5
和你一样,我需要从画一条曲线point(x1, y1)
来point (x2, y2)
.我做了一些搜索,引导我到Path类(android.graphics.Path
).Path有许多绘制线条的方法.创建路径后,使用draw方法创建实际线.可以旋转,转换,保存和添加路径.还有用这个类绘制的弧形,圆形和矩形.
http://developer.android.com/reference/android/graphics/Path.html
设置路径的起点→ mPath.moveTo(x1, y1);
设置常量和终点→ mPath.quadTo(cx, cy, x2, y2);
将路径转换为行→ canvas.drawPath(mPath, mPaint);
归档时间: |
|
查看次数: |
6954 次 |
最近记录: |