-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
Description
It does not fill from the starting and ending points.
package main
import (
"image"
"image/color"
"github.com/llgcode/draw2d/draw2dimg"
)
func main() {
img := image.NewRGBA(image.Rect(0, 0, 400, 400))
c := draw2dimg.NewGraphicContext(img)
c.SetFillColor(color.Black)
c.Clear()
c.SetLineWidth(2)
c.SetFillColor(color.RGBA{255, 0, 0, 255})
c.SetStrokeColor(color.White)
c.MoveTo(300, 50)
c.LineTo(150, 286)
c.LineTo(149, 113)
// c.Close()
c.FillStroke()
draw2dimg.SaveToPngFile("triangle.png", img)
}