@Grab(group='org.codehaus.griffon', module='jsilhouette-geom', version='0.4') import java.awt.* import java.awt.image.* import java.io.* import javax.imageio.* import org.codehaus.griffon.jsilhouette.geom.* // 放射ストライプを描画する def img = new BufferedImage( 200, 200, BufferedImage.TYPE_INT_ARGB ) def gr = img.createGraphics() gr.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ) def radius = 200 def nrays = 10 def rays = new Rays(img.getWidth()/2, img.getHeight()/2, radius, nrays ) gr.setColor(new Color((int)0xccddff)) gr.fill(rays) gr.dispose() ImageIO.write(img, "png", new File("rays.png"))
出力画像
動作環境
groovy 1.8.6, JDK7 update4
No comments:
Post a Comment