Thank you All.
I could do the thing I want to do.
It is below.
--------
package main
import (
"
github.com/akavel/polyclip-go"
"
github.com/akavel/polyclip-go/polyutil"
"image"
"image/color"
"image/draw"
"image/png"
"os"
)
var list []float64 = []float64{x0, y0, x1, y1,......}
func main() {
m := image.NewRGBA(image.Rect(0, 0, 500, 500))
draw.Draw(m, m.Bounds(), &image.Uniform{color.RGBA{0, 0, 255,
255}}, image.ZP, draw.Src)
pts := list2points(list)
polyutil.DrawPolyline(pts, brush(m))
w, _ := os.Create("new.png")
defer w.Close()
png.Encode(w, m)
}
func brush(im draw.Image) func(x, y int) {
return func(x, y int) {
im.Set(x, y, color.RGBA{255, 255, 255, 255})
}
}
func list2points(l []float64) []polyclip.Point {
pts := make([]polyclip.Point, 0)
for i := 0; i < len(l); i = i + 2 {
p := polyclip.Point{l[i], l[i+1]}
pts = append(pts, p)
}
return pts
}
--------
2013/7/10 Mateusz Czapliński <
czap...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>