Documentation
¶
Overview ¶
Package renderer 图片和卡片绘制api
Index ¶
- func ReadFromPath(path string) (image.Image, error)
- func Txt2Img(ctx *zero.Ctx, txt string)
- type Image
- func (i *Image) Blur(delta float64) image.Image
- func (i *Image) DrawBackground(path string) error
- func (i *Image) DrawCopyright(copyright string, point float64)
- func (i *Image) DrawImages(imgs []*ImageWithXY) *Image
- func (i *Image) Fillet(r float64) image.Image
- func (i *Image) LoadFont(fontPath string) error
- func (i *Image) ParseFontFace(point float64) error
- func (i *Image) ScaleByPercent(factor float64) *Image
- func (i *Image) ScaleToSize(targetWidth, targetHeight int) *Image
- func (i *Image) ToBase64() ([]byte, error)
- func (i *Image) ToBytes() ([]byte, error)
- func (i *Image) ToImage() image.Image
- func (i *Image) WithXY(x, y int) *ImageWithXY
- type ImageWithXY
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Image ¶
Image 图片绘制
func NewImageByImage ¶
NewImageByImage 使用image.Image 创建图片
func (*Image) DrawBackground ¶
DrawBackground 绘制背景
func (*Image) DrawImages ¶
func (i *Image) DrawImages(imgs []*ImageWithXY) *Image
DrawImages 将imgs 绘制到Image 结构体上的指定坐标
func (*Image) ParseFontFace ¶
ParseFontFace 使用Image.FontByte 字体,大小为point
func (*Image) ScaleByPercent ¶
ScaleByPercent 百分比缩放
func (*Image) ScaleToSize ¶
ScaleToSize 缩放到指定宽高
type ImageWithXY ¶
ImageWithXY 含有坐标信息的图片
func NewImageWithXY ¶
func NewImageWithXY(img *Image, x, y int) *ImageWithXY
NewImageWithXY 使用Image 创建位置在 (x, y) 的图片
Click to show internal directories.
Click to hide internal directories.