image

package
v0.0.0-...-852048f Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawLabel

func DrawLabel(m draw.Image, l Label, x, y int) error

DrawLabel Draw label l on position (x,y) of m Image

func Encode

func Encode(w io.Writer, m image.Image, f string) (int, error)

Encode writes the Image m to w in the f format (PNG, JPEG). Any Image may be encoded, but images that are not image.NRGBA might be encoded lossily.

func NewImage

func NewImage(w, h int, c color.Color) *image.NRGBA

NewImage return a new image.Image of w x h size and c Color

Types

type Label

type Label struct {
	freetype.Context

	Text   string
	Color  color.Color
	Width  int
	Height int
}

Label struct

func NewLabel

func NewLabel(text string, color color.Color, dpi float64, f *truetype.Font, fontSize float64) *Label

NewLabel return a new *Label

Jump to

Keyboard shortcuts

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