gg/examples/mask.go

21 lines
296 B
Go
Raw Normal View History

2016-09-28 16:25:10 +02:00
package main
import (
"log"
"github.com/fogleman/gg"
)
func main() {
2019-02-20 23:12:06 +01:00
im, err := gg.LoadImage("examples/baboon.png")
2016-09-28 16:25:10 +02:00
if err != nil {
log.Fatal(err)
}
dc := gg.NewContext(512, 512)
dc.DrawRoundedRectangle(0, 0, 512, 512, 64)
dc.Clip()
dc.DrawImage(im, 0, 0)
dc.SavePNG("out.png")
}