Documentation ¶
Index ¶
- func ImageResize(input image.Image, width uint, height uint) image.Image
- func ImageRound(input image.Image) image.Image
- func LoadLocalFont(fontPath string, fontSize float64) (font.Face, error)
- func LoadLocalImage(imagePath string) (image.Image, error)
- type Canvas
- func (canvas *Canvas) DrawImage(img image.Image, offsetX int, offsetY int)
- func (canvas *Canvas) DrawLine(color color.Color, offsetX, offsetY, length float64)
- func (canvas *Canvas) DrawRect(x, y, w, h float64, c color.Color)
- func (canvas *Canvas) DrawText(opt *TextConfig) error
- func (canvas *Canvas) MeasureString(opt *TextConfig) float64
- func (canvas *Canvas) Output() ([]byte, error)
- func (canvas *Canvas) SavePNG(path string) error
- type TextConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImageResize ¶
ImageResize 图片缩放
func LoadLocalFont ¶
LoadLocalFont 字体缓存在内存中
Types ¶
type Canvas ¶
Canvas 画布
func NewCanvasWithImage ¶
NewCanvasWithImage 从图片创建新的画布
func NewCanvasWithLocalImagePath ¶
NewCanvasWithLocalImagePath 从本地图片创建新的画布
func (*Canvas) MeasureString ¶
func (canvas *Canvas) MeasureString(opt *TextConfig) float64
MeasureString 测量文字
Click to show internal directories.
Click to hide internal directories.