-
Notifications
You must be signed in to change notification settings - Fork 91
CanvasUtils
sloop edited this page Jun 15, 2016
·
3 revisions
这是一个Canvas辅助工具,封装一些Canvas中没有但很常用的方法。
目前来时,只有一个功能,根据两个点(Point)来绘制线段,它的方法如下:
public void drawLine(Point p1, Point p2, Canvas canvas, Paint paint)
public void drawLine(PointF p1, PointF p2, Canvas canvas, Paint paint)
使用方式大致如下:
Point p1 = new Point(100,100);
Point p2 = new Point(500,500);
CanvasUtils.drawLine(p1, p2, canvas, mDeafultPaint);