gimage

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToImage

func Base64ToImage(data string, targetDir string, imageName string) (string, error)

将 Base64 转换为图片

func ImageToBase64

func ImageToBase64(imageUri string, removeImage bool) (string, error)

图片转Base64

func RandColor

func RandColor(maxColor int) (r, g, b, a int)

随机颜色

func RandPos

func RandPos(width, height int) (x float64, y float64)

随机坐标

func VerificationCode

func VerificationCode(conf VerificationCodeConfig) (string, string, error)

Types

type VerificationCodeConfig

type VerificationCodeConfig struct {
	Width        int
	Height       int
	CodeLength   int
	NumberLength int
	FontSize     float64
	FontPath     string
	LineNumber   int
	TmpDir       string
	CodeColor    []float64
}

Jump to

Keyboard shortcuts

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