import griffon.builder.gfx.render.*
import javax.imageio.*;
img1 = ImageIO.read(new File("flower1.png"))
img2 = ImageIO.read(new File("flower2.png"))
gr = new GfxRenderer()
img = gr.render(img1.width + img2.width,
img1.height + img2.height){
image(image: img1, x:0, y:0)
image(image: img2, x:img1.width, y:0)
image(image: img2, x:0, y:img1.height)
image(image: img1, x:img2.width, y:img2.height)
}
gr.renderToFile("sample1427a.png", 200, 200){
antialias("on")
rect(x:0, y:0, width: 200,
height: 200, borderColor:no){
texturePaint(x: 0, y: 0, image: img )
}
}
元画像1(flower1.png)
元画像2(flower2.png)
出力画像(sample1427a.png)
動作環境
Groovy1.6.5, JDK6 Update16
No comments:
Post a Comment