import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample808a.png", 200, 200){
 antialias("on")
 roundRect( x:10, y:10, width:180, height:180,
   topLeftHeight: 10, topLeftWidth:10,
   topRightHeight: 20, topRightWidth:20,
   bottomLeftHeight: 30, bottomLeftWidth:30,
   bottomRightHeight: 40, bottomRightWidth:40,
   fill: color("#bbddff"),
   borderColor: color("#103080"),
   borderWidth: 2
 )
}
出力画像(sample808a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
groovyで四角を描画する
groovyで角丸四角を描画する
groovyで正多角形を描画する
groovyでサイの形を描画する
 
No comments:
Post a Comment