Scala de image

勉強をかねて作り中
以下のように画像生成できる奴

import ryugate.image._

import java.io.File
import java.awt.Color

object graph_test extends Application {
  val img = new Image(300,200)
  img.process {
      g.setAntialias(true)
      g.clearRect(0, 0, 50, 50)
      g.line(20, 20, 110, 140)
    })
    
    g.line(20, 20, 110, 140)

    g.line(20, 20, 110, 140)
    g.arc_chord(70, 60, 100, 100, 90, 135)

    g.antialias((g) => { 
      g.drawString("あいうえおhoge", 50,50)
      g.line(150, 20, 240, 140)
      g.arc_chord(200, 60, 100, 100, 90, 135)
    })
  })

  img.write("png", new File("sample.png"">*1
}

*1:g) => { g.setFont("IPAGothic", Font.BOLD, 20) g.setBackground(Color.BLUE) g.clearRect(50, 50, 180, 80) g.layer(20,20, 100,100, (g) => { g.setAntialias(true) g.clearRect(0, 0, 50, 50) g.line(20, 20, 110, 140) }) g.line(20, 20, 110, 140) g.line(20, 20, 110, 140) g.arc_chord(70, 60, 100, 100, 90, 135) g.antialias((g) => { g.drawString("あいうえおhoge", 50,50) g.line(150, 20, 240, 140) g.arc_chord(200, 60, 100, 100, 90, 135) }) }) img.write("png", new File("sample.png"