Documentation ¶
Index ¶
- Constants
- func ColorToRGB(colorVal int) color.RGBA
- func NewApplication() captcha.Captcha
- func RandFontFamily() (*truetype.Font, error)
- func RandLightColor() color.RGBA
- func RandText(num int) string
- func Random(min int64, max int64) float64
- func ReadFonts(dirPth string, suffix string) (err error)
- func SetFontFamily(fontPath ...string)
- type Application
- type CaptchaImage
- func (captcha *CaptchaImage) ClearImage()
- func (captcha *CaptchaImage) DrawBeeline(point1 captcha.Point, point2 captcha.Point, lineColor color.RGBA)
- func (captcha *CaptchaImage) DrawBorder(borderColor color.RGBA)
- func (captcha *CaptchaImage) DrawHollowLine()
- func (_captcha *CaptchaImage) DrawLine(num int)
- func (captcha *CaptchaImage) DrawNoise(complex captcha.CaptchaComplex)
- func (captcha *CaptchaImage) DrawSineLine()
- func (captcha *CaptchaImage) DrawText(text string)
- func (captcha *CaptchaImage) DrawTextNoise(complex captcha.CaptchaComplex)
- func (captcha *CaptchaImage) NewCaptchaImage() (img string, err error)
- func (captcha *CaptchaImage) SaveImage() (img string)
- type ImageFormat
- type ServiceProvider
Constants ¶
View Source
const ( //验证码噪点强度 CaptchaComplexLower captcha.CaptchaComplex = iota CaptchaComplexMedium CaptchaComplexHigh )
Variables ¶
This section is empty.
Functions ¶
func ColorToRGB ¶
颜色代码转换为RGB input int output int red, green, blue.
func NewApplication ¶
Types ¶
type Application ¶
type Application struct { }
type CaptchaImage ¶
func NewCaptcha ¶
func NewCaptcha() *CaptchaImage
func (*CaptchaImage) DrawBeeline ¶
func (captcha *CaptchaImage) DrawBeeline(point1 captcha.Point, point2 captcha.Point, lineColor color.RGBA)
画直线.
func (*CaptchaImage) DrawBorder ¶
func (captcha *CaptchaImage) DrawBorder(borderColor color.RGBA)
画边框.
func (*CaptchaImage) DrawNoise ¶
func (captcha *CaptchaImage) DrawNoise(complex captcha.CaptchaComplex)
画噪点.
func (*CaptchaImage) DrawTextNoise ¶
func (captcha *CaptchaImage) DrawTextNoise(complex captcha.CaptchaComplex)
画文字噪点.
func (*CaptchaImage) NewCaptchaImage ¶
func (captcha *CaptchaImage) NewCaptchaImage() (img string, err error)
type ImageFormat ¶
type ImageFormat int
const ( //图片格式 ImageFormatPng ImageFormat = iota ImageFormatJpeg ImageFormatGif )
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (captcha *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (captcha *ServiceProvider) Register()
Click to show internal directories.
Click to hide internal directories.