canvas

package
v0.0.0-...-0e6b51b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFont

func LoadFont(path string) (*truetype.Font, error)

func LoadImage

func LoadImage(data []byte) (image.Image, string, error)

Types

type Canvas

type Canvas interface {
	Image() image.Image
	Width() int
	Height() int
	Clear()
	ClearPath()
	Clip()
	ResetClip()
	ClosePath()
	BeginPath()
	CubicTo(x1, y1, x2, y2, x3, y3 float64)
	Arc(x, y, r, angle1, angle2 float64)
	Circle(x, y, r float64)
	Ellipse(x, y, rx, ry float64)
	Line(x1, y1, x2, y2 float64)
	Rectangle(x, y, w, h float64)
	RoundedRectangle(x, y, w, h, r float64)
	DrawImage(im image.Image, x, y int)
	DrawString(s string, x, y float64)
	Fill()
	LineTo(x, y float64)
	SetFont(v font.Face)
	MeasureString(s string) (w, h float64)
	MoveTo(x, y float64)
	Save()
	Restore()
	QuadraticTo(x1, y1, x2, y2 float64)
	Scale(x, y float64)
	SetColor(c color.Color)
	SetDash(dashes ...float64)
	SetDashOffset(offset float64)
	SetHexColor(x string)
	SetLineWidth(lineWidth float64)
	Stroke()
	Rotate(angle float64)
	Translate(x, y float64)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL