PShape / getFill
in
Programming Questions
•
5 months ago
Hello, I try fo find the property fill, stroke and strokeWeight of children shape but I've problem with the index or something to acces at the information.
- // The next line is needed if running in JavaScript Mode with Processing.js
/* @pjs preload="usa-wikipedia.svg"; */
PShape original;
PShape[] childrenShape ; // to create a shape children from SVG
void setup() {
original = loadShape("illustrator.svg");
// println(original.getChildIndex(original)) ;
// println(original.getChildren()) ;
// println(original.getFamily()) ;
int numChildren ;
numChildren = original.getChildCount();
if ( numChildren > 0 ) {
for ( int i = 0 ; i < numChildren ; i++) {
// childrenShape = original.getChildren() ;
// println(original.getFill(childrenShape[i])) ;
println(original.getFill(i)) ;
}
}
// println(original.getFill(0)) ;
}
Thx
Stan
Stan
1