img

package
v0.0.0-...-4a0e227 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Img

type Img struct {
	Height       int    //图片高度
	Width        int    //图片宽度
	NoiseCount   int    //干扰线
	Count        int    //验证码数量
	Source       string //数据源
	SourceLength int    //数据源长度
	FontColor    color.Color
	SizePoint    float64     //字体大小
	BgColor      color.NRGBA //背景颜色
	FontStyle    font.Face   //字体
	UploadImg    image.Image
	MathNum      int //算术验证码数量
	PuzzleX      int // 滑动拼图的X位置
	PuzzleY      int // 滑动拼图的Y位置
	PuzzleWidth  int // 拼图块的宽度
	PuzzleHeight int // 拼图块的高度
}

func DefaultImg

func DefaultImg() Img

func LoadLocalImg

func LoadLocalImg(imgPath string) Img

func NewDriverString

func NewDriverString(imgOptions ...Img) *Img

func (*Img) GenerateDriverMath

func (m *Img) GenerateDriverMath() (content, answer string)

func (*Img) GenerateDriverMathString

func (m *Img) GenerateDriverMathString() (content, answer string, err error)

func (*Img) GenerateDriverPuzzle

func (m *Img) GenerateDriverPuzzle() (bgImage string, puzzleImage string, targetX int, err error)

func (*Img) GenerateDriverString

func (m *Img) GenerateDriverString() (content, answer string, err error)

type ImgOptions

type ImgOptions struct {
	Height       int         //图片高度
	Width        int         //图片宽度
	NoiseCount   int         //干扰线
	Count        int         //验证码数量
	Source       string      //数据源
	SourceLength int         //数据源长度
	SizePoint    float64     //字体大小
	Bgcolor      color.NRGBA //背景颜色
	FontStyle    font.Face   //字体
	UploadImg    image.Image

	MathNum      int //算术验证码数量
	PuzzleX      int // 滑动拼图的X位置
	PuzzleY      int // 滑动拼图的Y位置
	PuzzleWidth  int // 拼图块的宽度
	PuzzleHeight int // 拼图块的高度
}

Jump to

Keyboard shortcuts

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