Documentation ¶ Index ¶ func GetImg(imagePath string) (img image.Image, err error) func Resize(img image.Image, width, height uint) image.Image type HDC func (h *HDC) DrawImg(img image.Image, point image.Point) func (h *HDC) DrawText(pen Pen, text string) bool func (h *HDC) GetBgSize() (w, _h int) func (h *HDC) Save(imagePath string) bool func (h *HDC) SetBg(imagePath string) bool type Pen func OnGetPen(fontPath string, R, G, B, A uint8) (pen Pen, b bool) 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) 获取画笔 Source Files ¶ View all Source files mydraw.go Click to show internal directories. Click to hide internal directories.