summaryrefslogtreecommitdiff
path: root/vendor/github.com/fogleman/gg/examples/ellipse.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fogleman/gg/examples/ellipse.go')
-rw-r--r--vendor/github.com/fogleman/gg/examples/ellipse.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/fogleman/gg/examples/ellipse.go b/vendor/github.com/fogleman/gg/examples/ellipse.go
new file mode 100644
index 0000000..e0de9f4
--- /dev/null
+++ b/vendor/github.com/fogleman/gg/examples/ellipse.go
@@ -0,0 +1,20 @@
+package main
+
+import "github.com/fogleman/gg"
+
+func main() {
+ const S = 1024
+ dc := gg.NewContext(S, S)
+ dc.SetRGBA(0, 0, 0, 0.1)
+ for i := 0; i < 360; i += 15 {
+ dc.Push()
+ dc.RotateAbout(gg.Radians(float64(i)), S/2, S/2)
+ dc.DrawEllipse(S/2, S/2, S*7/16, S/8)
+ dc.Fill()
+ dc.Pop()
+ }
+ if im, err := gg.LoadImage("examples/gopher.png"); err == nil {
+ dc.DrawImageAnchored(im, S/2, S/2, 0.5, 0.5)
+ }
+ dc.SavePNG("out.png")
+}