Creates an image based paint. It is recommended that the image should have small dimensions as it will be tiled and copied to fit the Shape's bounds.
Properties
| Property | Default | Notes |
|---|---|---|
| x | 0 | |
| y | 0 | |
| width | if specified will override the image's width | |
| height | if specified will override the image's height | |
| image | must be a java.awt.Image, an image or shape operation | |
| classpath | String | |
| url | URL or String | |
| file | File or String |
You must specify ate least any of [image,classpath,url,file]
Example
rect( width: 200, height: 200, borderColor: false ){
gradientPaint()
}
texturePaint( id: 'p', x: 0, y: 0, file: 'c:\\tmp\\groovy-logo.png' )
rect( x: 0, y: 0, width: 100, height: 100, borderColor: 'red', fill: p, )
circle( cx: 150, cy: 50, radius: 50, borderColor: 'red', fill: p )
rect( x: 0, y: 100, width: 200, height: 100, borderColor: 'red', fill: p )

renderingHint( key: 'antialiasing', value: 'antialias on' ) rect( width: 20, height: 20, borderColor: false, asShape: true, id: 'r' ){ gradientPaint( y2: 50, color2: 'blue' ) transformations { rotate(angle:45) } } circle( cx: 125, cy: 125, radius: 70, asShape: true, id: 'c' ) draw( shape: c ){ gradientPaint( color2: 'red' ) } rect( x:20, y: 20, width: 200, height: 200 ){ texturePaint( image: r ) }







