| | |
| | | } |
| | | canvas2.drawPath(path,paint); |
| | | //画虚线(分道线) |
| | | paint.reset(); |
| | | paint.setStyle(Paint.Style.STROKE); |
| | | paint.setStrokeWidth(1.5f); |
| | | paint.setAntiAlias(true); |
| | | // paint.setColor(Color.WHITE); |
| | | paint.setPathEffect(new DashPathEffect(new float[] {15, 15}, 0)); |
| | | |
| | | Paint paintFenDao = new Paint(Paint.ANTI_ALIAS_FLAG); |
| | | Path pathFenDao = new Path(); |
| | | paintFenDao.reset(); |
| | | paintFenDao.setStyle(Paint.Style.STROKE); |
| | | paintFenDao.setStrokeWidth(1.5f); |
| | | paintFenDao.setAntiAlias(true); |
| | | paintFenDao.setPathEffect(new DashPathEffect(new float[] {15, 15}, 0)); |
| | | for (List<Integer> greenline: |
| | | greenLines){ |
| | | for (int j = 0; j < greenline.size(); j++) { |
| | | int pos = greenline.get(j); |
| | | if (j == 0){ |
| | | path.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | pathFenDao.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | } |
| | | path.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | pathFenDao.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | Log.i(TAG,String.format("map[%d][0]=%f,map[%d][1]=%f,line to (%f,%f)",pos,map[pos][0],pos,map[pos][1], |
| | | (float) (base_x + (map[pos][0] - min_x) * scale_x),(float) (base_y + (map[pos][1] - min_y) * scale_y))); |
| | | } |
| | | } |
| | | canvas2.drawPath(path,paint); |
| | | canvas2.drawPath(pathFenDao,paintFenDao); |
| | | |
| | | }else{ |
| | | List<Integer> area = mapItem.getArea(); |