Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 a image shape operation

classpath

 

String

url

 

URL or String

file

 

File or String

...

Code Block
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 )

Code Block

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 )
}

Image Added