我有一个SurfaceView,当用户进行触摸移动时,我在起点和手指定位的实际点之间绘制一条直线RED线。那部分还可以。但是现在,我不需要绘制一条RED线,而是需要由小星星(位图)组成的线,在两点之间形成一条直线。我怎么能这样做?
这是我的代码:
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(Color.RED);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(24);
...
mPath.reset();
mPath.moveTo(mX, mY);
mPath.lineTo(x, y);
...
@Override
protected void draw() {
mCanvas.drawPath(mPath, mPaint);
}