toimage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MulanPSL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRemoteImageToPNG

func ConvertRemoteImageToPNG(imageURL string, output *os.File) error

ConvertRemoteImageToPNG 图片强转png

func CreateDir added in v0.2.0

func CreateDir(dirPath string, isFile ...bool) error

CreateDir 创建指定的目录,包括所有必要的父目录。

isFile 如果路径为文件将过滤掉最后一级的图片

func ExecPath added in v0.2.0

func ExecPath(fileName ...string) string

func ModePath added in v0.2.0

func ModePath() string

func RenderTextToPNG

func RenderTextToPNG(text string, fontPaths []string, outputOrFile any, args ...TextToPngArgs) error

RenderTextToPNG

text 字符串  fontPaths字体路径集合 outputPath图片输出路径或图片文件对象 args其它属性配置 字体大小12|指定宽度|指定高度
																	宽高不指定将根据字体大小自适应

Types

type TextToPngArgs

type TextToPngArgs struct {
	Color               color.Color
	Size, Width, Height int
}

Jump to

Keyboard shortcuts

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