Documentation
¶
Index ¶
- func AdjustOpacity(m image.Image, percentage float64) image.Image
- func ClipImgToCircle(img image.Image) image.Image
- func GenQQListMsgWithAva(data map[int64]string, w float64, isUser bool) (msg message.MessageSegment, err error)
- func MeasureStringDefault(str string, fontSize, lineSpace float64) (float64, float64)
- func ParseFont(path string) (*truetype.Font, error)
- type ImageCtx
- func (img *ImageCtx) GenMessageAuto() (message.MessageSegment, error)
- func (img *ImageCtx) GenMessageBase64() (message.MessageSegment, error)
- func (img *ImageCtx) PasteLine(x1, y1, x2, y2, lineWidth float64, colorStr string)
- func (img *ImageCtx) PasteStringDefault(str string, fontSize, lineSpace float64, x, y, width float64) error
- func (img *ImageCtx) SaveTemp(prefix string) (string, error)
- func (img *ImageCtx) SaveTempDefault() (string, error)
- func (img *ImageCtx) SetColorAuto(colorStr string)
- func (img *ImageCtx) SetFont(font *truetype.Font, size float64) error
- func (img *ImageCtx) UseDefaultFont(size float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustOpacity ¶
AdjustOpacity 将输入图像m的透明度变为原来的倍数的图像返回。若原来为完成全不透明,则percentage = 0.5将变为半透明
func GenQQListMsgWithAva ¶
func GenQQListMsgWithAva(data map[int64]string, w float64, isUser bool) (msg message.MessageSegment, err error)
GenQQListMsgWithAva 生成带QQ头像的用户或群(以isUser参数区分)列表
func MeasureStringDefault ¶
MeasureStringDefault 测量str在默认情况(默认字体、分行)下的长宽
Types ¶
type ImageCtx ¶
ImageCtx 图片上下文
func NewImageCtxWithBG ¶
NewImageCtxWithBG 创建带有背景图片的图片上下文,通过opacity设置不透明度
func NewImageCtxWithBGPath ¶
NewImageCtxWithBGPath 以背景图片路径创建带有背景图片的图片上下文
func NewImageCtxWithBGRGBA255 ¶
NewImageCtxWithBGRGBA255 以RGBA255形式创建纯色背景的图片上下文
func (*ImageCtx) GenMessageAuto ¶
func (img *ImageCtx) GenMessageAuto() (message.MessageSegment, error)
GenMessageAuto 自动生成ZeroBot图片消息
func (*ImageCtx) GenMessageBase64 ¶
func (img *ImageCtx) GenMessageBase64() (message.MessageSegment, error)
func (*ImageCtx) PasteStringDefault ¶
func (img *ImageCtx) PasteStringDefault(str string, fontSize, lineSpace float64, x, y, width float64) error
PasteStringDefault 以默认方式(默认字体、黑色、Wrapped、左上角定位、文字居左)贴文字
func (*ImageCtx) SaveTempDefault ¶
SaveTempDefault 以默认前缀(tempimg)保存至临时图片文件夹
func (*ImageCtx) SetColorAuto ¶
func (*ImageCtx) UseDefaultFont ¶
UseDefaultFont 使用默认字体并设置字体大小
Click to show internal directories.
Click to hide internal directories.