Documentation ¶
Index ¶
- Constants
- type Captcha
- func (captcha *Captcha) GetFormulaMixData() (string, []string)
- func (captcha *Captcha) GetRandCode() string
- func (captcha *Captcha) OutPut() (string, *image.RGBA)
- func (captcha *Captcha) RangeRand(min, max int64) int64
- func (captcha *Captcha) SetCode(code string)
- func (captcha *Captcha) SetFontName(FontName string)
- func (captcha *Captcha) SetFontPath(FontPath string)
- func (captcha *Captcha) SetFontSize(fontSize float64)
- func (captcha *Captcha) SetMode(mode int)
Constants ¶
View Source
const ( // ModeRandCode 模式 0-普通字符串 1-数学公式 ModeRandCode = 0 ModeFormulaMix = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Captcha ¶
type Captcha struct {
W, H, CodeLen int
FontSize float64
Dpi int
FontPath, FontName string
// contains filtered or unexported fields
}
Captcha 图形验证码 使用字体默认ttf格式 w 图片宽度, h图片高度,CodeLen验证码的个数 FontSize 字体大小, Dpi 清晰度,FontPath 字体目录, FontName 字体名字 mode 验证模式 0:普通字符串,1:10以内简单数学公式
func (*Captcha) GetFormulaMixData ¶
GetFormulaMixData 获取算术运算公式
func (*Captcha) SetFontName ¶
SetFontName 设置字体名称
func (*Captcha) SetFontPath ¶
SetFontPath 设置字体路径
func (*Captcha) SetFontSize ¶
SetFontSize 设置字体大小
Click to show internal directories.
Click to hide internal directories.