pattern()
Produces an SVG "pattern"
element.
Syntax
pattern(
id STRING,
x DECIMAL,
y DECIMAL,
width DECIMAL,
height DECIMAL,
patternUnits STRING,
patternContentUnits STRING,
patternTransform STRING,
preserveAspectRatio STRING )
RETURNS om.DomNode
- id is the SVG object identifier.
- x defines the X coordinate where the patterm starts.
- y defines the Y coordinate where the patterm starts.
- width defines the width of the pattern.
- height defines the height of the pattern.
- patternUnits defines the patternUnits attribute.
- patternContentUnits defines the patternContentUnits attribute.
- patternTransform defines the patternTransform attribute.
- preserveAspectRatio is the aspect ratio to preserve.
Usage
This function creates a "pattern"
SVG DOM element from the parameters.
The resulting DOM can be used in a "defs"
element created with the defs()
function, to
produce pattern definitions.
Example
DEFINE pattern, n om.DomNode
...
LET pattern = fglsvgcanvas.pattern( "pattern1", 0,0,20,20, "userSpaceOnUse",
NULL, "rotate(45)", NULL )
CALL pattern.appendChild( n:=fglsvgcanvas.rect(0,0,1000,10,NULL,NULL) )
CALL n.setAttribute(SVGATT_STYLE, 'stroke:none; fill:blue;' )
CALL pattern.appendChild( n:=fglsvgcanvas.rect(0,10,1000,10,NULL,NULL) )
CALL n.setAttribute(SVGATT_STYLE, 'stroke:none; fill:navy;' )