From 2473675902694726f9b2453237f2c4d033b91f14 Mon Sep 17 00:00:00 2001 From: Michael Fogleman Date: Sun, 21 Feb 2016 16:57:17 -0500 Subject: [PATCH] linewidth example --- examples/linewidth.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/linewidth.go diff --git a/examples/linewidth.go b/examples/linewidth.go new file mode 100644 index 0000000..8cdfdca --- /dev/null +++ b/examples/linewidth.go @@ -0,0 +1,19 @@ +package main + +import "github.com/fogleman/gg" + +func main() { + dc := gg.NewContext(1000, 1000) + dc.SetRGB(1, 1, 1) + dc.Clear() + dc.SetRGB(0, 0, 0) + w := 0.1 + for i := 100; i <= 900; i += 20 { + x := float64(i) + dc.DrawLine(x+50, 0, x-50, 1000) + dc.SetLineWidth(w) + dc.Stroke() + w += 0.1 + } + dc.SavePNG("out.png") +}