对于我正在使用的应用程序,我正在使用给定坐标在画布上画一条线。问题是我需要在它旁边画一条虚线。由于坐标来自API,我只能使用这些坐标来表示虚线。有什么办法可以做到这一点?我真的无法弄清楚。在画布上用另一条虚线画线
我画我的当前行的方式:
Path line = new Path();
boolean first = true;
for (CircleArea circle : mCircles) {
canv.drawCircle(circle.getDrawX(), circle.getDrawY(), mCircleRadius, mCirclePaint);
if(!first) {
line.lineTo(circle.getDrawX(), circle.getDrawY());
} else {
line.moveTo(circle.getDrawX(), circle.getDrawY());
}
first = false;
}
canv.drawPath(line, mLinePaint);
,样品坐标:
- 50,50
- 75,75
- 100,75
- 150,10
- 170,10
- 170,75
- 160,75
您能否提供您从服务器获得的坐标示例列表? –
添加样本坐标,使用这些坐标,画布的最大x和y值为200,100。 –