path From Points - Android Graphics

Android examples for Graphics:Path Point

Description

path From Points

Demo Code


//package com.java2s;
import java.util.List;
import android.graphics.Path;
import android.graphics.Point;

public class Main {
    public static Path pathFromPoints(List<Point> points) {
        Path path = new Path();
        Point start = points.get(0);
        path.moveTo((float) start.x, (float) start.y);
        int l = points.size();
        for (int i = 1; i < l; i++) {
            Point point = points.get(i);
            path.lineTo((float) point.x, (float) point.y);
        }//w  ww  .  j  a v a2  s.co  m
        return path;
    }
}

Related Tutorials