Beispiel #1
0
func (h *HilbertImage) drawLine(gc *draw2d.ImageGraphicContext, px1, py1, px2, py2 float64) {
	gc.SetStrokeColor(h.SnakeColor)
	gc.SetLineWidth(3)
	gc.MoveTo(px1, py1)
	gc.LineTo(px2, py2)
	gc.Stroke()
}
Beispiel #2
0
func (h *HilbertImage) drawRectange(gc *draw2d.ImageGraphicContext, px1, py1, px2, py2 float64) {
	gc.SetFillColor(h.BackgroundColor)
	gc.SetStrokeColor(h.GridColor)
	gc.SetLineWidth(1)

	draw2d.Rect(gc, px1, py1, px2, py2)
	gc.FillStroke()
}
Beispiel #3
0
func (h *HilbertImage) drawText(gc *draw2d.ImageGraphicContext, px1, py1 float64, t int) {
	if !h.DrawText {
		return
	}

	text := strconv.Itoa(t)
	_, top, _, _ := gc.GetStringBounds(text)

	gc.SetFillColor(h.TextColor)
	gc.FillStringAt(text, px1+h.TextMargin, py1-top+h.TextMargin)
}