import org.codehaus.groovy.scriptom.*
Scriptom.inApartment
{
im = new ActiveXObject("ImageMagickObject.MagickImage.1")
im.convert("-size", "200x200", "xc:none", "-stroke", "#113377",
"-fill", "#bbddff", "-font", "c:\\windows\\fonts\\msmincho.ttc",
"-pointsize", "60", "-gravity", "center",
"-draw", "text 0,0 '日本語'",
"sample1073a.png")
}
出力画像(sample1073a.png)

動作環境
Groovy1.6.0, JDK1.6 Update12, ImageMagick6.5.0, Microsoft VC++ 2008 Redistributable
※ImageMagickインストール時にCOMインターフェイスも入れておくこと。
関連項目
groovyで日本語を描画する
No comments:
Post a Comment