Skip to content Skip to sidebar Skip to footer

Android - Remove Lines From Path

I need to make a realtime visual plot of some data much like the 'heart beat' scope. Currently, I have data that comes in and I append a Path using lineTo(int, int). When the plot

Solution 1:

You cannot remove any Path (or parts of a Path) from an existing Path, you can only add, see Path, hence you must manage the parts on your own. To do so you split the path in seperate chunks

Path[] chunks = new Path[2]; //two chunks should be enough
Path currentPath;

privatevoidreCreatePath(){
    currentPath = new Path(chunks[0]);
    currentPath.addPath(chunks[1]);
}

you can reCreate the path any time and and shift the content for the chunks

chunks[0] = chunks[1]; //moving chunks 1 -> chunks 0
chunks[1] = ... //add here your new PathreCreatePath(); //makes a new Path using data from chunks

Post a Comment for "Android - Remove Lines From Path"