mydraw

package
v0.0.0-...-2a383cf Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImg

func GetImg(imagePath string) (img image.Image, err error)

func Resize

func Resize(img image.Image, width, height uint) image.Image

Resize 设置图片高宽

Types

type HDC

type HDC struct {
	//Bg   image.Image
	Rgba *image.RGBA
}

func (*HDC) DrawImg

func (h *HDC) DrawImg(img image.Image, point image.Point)

图片上画图片

func (*HDC) DrawText

func (h *HDC) DrawText(pen Pen, text string) bool

图片上画文字

func (*HDC) GetBgSize

func (h *HDC) GetBgSize() (w, _h int)

func (*HDC) Save

func (h *HDC) Save(imagePath string) bool

保存图片

func (*HDC) SetBg

func (h *HDC) SetBg(imagePath string) bool

type Pen

type Pen struct {
	FontSize   float64
	Dpi        float64
	Font       *truetype.Font
	StartPoint image.Point
	Color      *image.Uniform
}

func OnGetPen

func OnGetPen(fontPath string, R, G, B, A uint8) (pen Pen, b bool)

获取画笔

Jump to

Keyboard shortcuts

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