import groovy.swing.j2d.svg.*
gr = new SVGRenderer()
gr.renderToFile("sample962a.svg", 200, 200){
font(new java.awt.Font('MS 明朝', java.awt.Font.BOLD, 60))
arrow( x: 10, y: 10, width: 150, height: 100,
angle:45,
fill: color("#bbddff"),
borderColor: color("#103080"),
borderWidth: 2
)
}
出力SVG(sample962a.svg)をPNGにレンダリングした画像
![SVGRendererで描画した矢印](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9S6ntWVP_YuUT88X0CxzGpB1KNEWBx-Dq5Zt9XB_B3cVsNZMZNCwzePgoMZ2b0R_bTfNUYPqvDpr7rRTRfqW3Suy_g-mFNNVx7TFC2leA30BOmmcSWELSRX2qs5j5ND5VqNRv/s320/sample962a.png)
動作環境
Groovy1.6.0, JDK1.6 Update12
No comments:
Post a Comment