img

package
v0.0.0-...-85e1034 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create()

func Image2RGBA

func Image2RGBA(img image.Image) *image.NRGBA

Image2RGBA Image2RGBA

func NewFont

func NewFont(font_path string) (font *truetype.Font, err error)

func NewFreeType

func NewFreeType(font_path string, size_font float64, clr color.Color) (c *freetype.Context, err error)

func PathExists

func PathExists(path string) bool

Types

type Img

type Img struct {
	ImgTpl image.Image

	ImgOut  *image.NRGBA
	ImgByte bytes.Buffer
	// contains filtered or unexported fields
}

func NewImage

func NewImage(img_tpl_path string) (img *Img, err error)

func (*Img) DrawImage

func (I *Img) DrawImage(img image.Image, resize_x float32, x, y float32) (err error)

func (*Img) DrawImageFile

func (I *Img) DrawImageFile(img_path string, resize_x float32, x, y float32) (err error)

func (*Img) DrawText

func (I *Img) DrawText(fontType *truetype.Font, size_font float64, clr color.Color, text string, x, y float32) (err error)

func (*Img) OutImage

func (I *Img) OutImage(file_path string) (err error)

func (*Img) PackImage

func (I *Img) PackImage() (err error)

type Qrcode

type Qrcode struct {
	ByteFile  []byte
	ImgQrcode image.Image
	// contains filtered or unexported fields
}

func NewQrcode

func NewQrcode(text string, ext string) (qrCode Qrcode, err error)

生成二维码

func (*Qrcode) OutQrcode

func (Q *Qrcode) OutQrcode(file_path string) (err error)

保存二维码

Jump to

Keyboard shortcuts

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