returns the number path points of "path". - Java 2D Graphics

Java examples for 2D Graphics:Path

Description

returns the number path points of "path".

Demo Code


//package com.java2s;
import java.awt.geom.PathIterator;
import java.awt.geom.GeneralPath;

public class Main {
    /** returns the number path points of "path". */
    public static int getNumPathPoints(GeneralPath path) {
        int count = 0;
        for (PathIterator i = path.getPathIterator(null); !i.isDone(); i
                .next()) {//from   w  w  w . j a  va2s .  c o m
            count++;
        }
        return count;
    }
}

Related Tutorials