linewidth example
This commit is contained in:
parent
a4e5cdbeb8
commit
2473675902
19
examples/linewidth.go
Normal file
19
examples/linewidth.go
Normal file
@ -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")
|
||||
}
|
Loading…
Reference in New Issue
Block a user