@Grab(group='com.jhlabs', module='filters', version='2.0.235') import java.awt.* import java.awt.geom.* import java.awt.image.* import java.io.* import javax.imageio.* import com.jhlabs.composite.* import com.jhlabs.image.* 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 arc = 40 def tabheight = 20 gr.setColor(new Color((int)0xFFBFB8A3)) def balloon = new Balloon(0, 0, img.getWidth(), img.getHeight()-tabheight, arc, tabheight*2, tabheight, Balloon.TAB_AT_BOTTOM, 0.5f //, Balloon.ANGLE_AT_START ) gr.fill(balloon) gr.dispose() ImageIO.write(img, "png", new File("drawballoon.png"))
出力画像
動作環境
groovy 1.8.6, JDK7 update4
No comments:
Post a Comment