diff --git a/examples/lenna.png b/examples/lenna.png new file mode 100644 index 0000000..59ef68a Binary files /dev/null and b/examples/lenna.png differ diff --git a/examples/mask.go b/examples/mask.go new file mode 100644 index 0000000..fb6b195 --- /dev/null +++ b/examples/mask.go @@ -0,0 +1,20 @@ +package main + +import ( + "log" + + "github.com/fogleman/gg" +) + +func main() { + im, err := gg.LoadImage("examples/lenna.png") + 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") +}