I have .svg
a file with some elements in it. Is there any way to draw them step by step on the canvas?
I'm using com.caverock:androidsvg
library, but it seems like there is no way to extract individual element.
I have .svg
a file with some elements in it. Is there any way to draw them step by step on the canvas?
I'm using com.caverock:androidsvg
library, but it seems like there is no way to extract individual element.
Here is my test example video. I copied one
Path
from 250 (the white outline in the middle of the image, that does not pan or scroll). It was the firstPath
in theSVG
document, and the first element in theList
ofPath'
sYes you can do this (at least for the important Path data), see Android path tracing tutorial, and the source code in the
github
here. The demo (road-trip
) extracts (actually itintercepts
) the Path's and also animates theseandroid.graphics.Path's
(withandroid.animation.ObjectAnimator
). You Tube.Note
Remember the
.SVG
format is a document file, not just a simple vector image type. You possibly could modify theviewBox
to select different images from your.SVG
document, using the code above.