Пример #1
0
func app(context *httpcanvas.Context) {
	for i := 0.0; i < 100; i++ {
		context.BeginPath()
		context.MoveTo(50+4*i, 50)
		context.LineTo(50+4*i, 100)
		context.Stroke()

		time.Sleep(1 * time.Second)
	}
}
Пример #2
0
func app(context *httpcanvas.Context) {
	context.BeginPath()
	context.MoveTo(50, 50)
	context.LineTo(200, 200)
	context.Stroke()

	time.Sleep(5 * time.Second)
	context.BeginPath()
	context.MoveTo(200, 50)
	context.LineTo(50, 200)
	context.Stroke()
}
Пример #3
0
func app(context *httpcanvas.Context) {
	centerX := context.Width / 2
	centerY := context.Height / 2

	context.BeginPath()
	context.Arc(centerX, centerY, 70, 0, 2*math.Pi, false)
	context.FillStyle("green")
	context.Fill()

	time.Sleep(5 * time.Second)

	context.LineWidth(5)
	context.StrokeStyle("#003300")
	context.Stroke()
}