Documentation ¶
Index ¶
- func AddFontFamily(fontPath ...string)
- func ColorToRGB(colorVal int) color.RGBA
- func FileSystem(fs embed.FS) error
- func RandFontFamily() (*truetype.Font, error)
- func RandLightColor() color.RGBA
- func RandText(num int) string
- func Random(min int64, max int64) float64
- func ReadFile(name string) ([]byte, error)
- func ReadFonts(dirPth string, suffix string) (err error)
- type CaptchaComplex
- type CaptchaImage
- func (captcha *CaptchaImage) DrawBorder(borderColor color.RGBA) *CaptchaImage
- func (captcha *CaptchaImage) DrawHollowLine() *CaptchaImage
- func (captcha *CaptchaImage) DrawLine(num int) *CaptchaImage
- func (captcha *CaptchaImage) DrawNoise(complex CaptchaComplex) *CaptchaImage
- func (captcha *CaptchaImage) DrawSineLine() *CaptchaImage
- func (captcha *CaptchaImage) DrawText(text string) *CaptchaImage
- func (captcha *CaptchaImage) DrawTextNoise(complex CaptchaComplex) *CaptchaImage
- func (captcha *CaptchaImage) Reset()
- func (captcha *CaptchaImage) Save() (io io.Reader, err error)
- func (captcha *CaptchaImage) SaveImage(w io.Writer, imageFormat ImageFormat) error
- type ImageFormat
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorToRGB ¶
颜色代码转换为RGB input int output int red, green, blue.
func FileSystem ¶
Types ¶
type CaptchaComplex ¶
type CaptchaComplex int
const ( //验证码噪点强度 CaptchaComplexLower CaptchaComplex = iota CaptchaComplexMedium CaptchaComplexHigh )
type CaptchaImage ¶
func NewCaptchaImage ¶
func NewCaptchaImage(width int, height int, bgColor color.RGBA) *CaptchaImage
NewCaptchaImage 新建一个图片对象 Deprecated: 弃用
func (*CaptchaImage) DrawBorder ¶
func (captcha *CaptchaImage) DrawBorder(borderColor color.RGBA) *CaptchaImage
DrawBorder 画边框.
func (*CaptchaImage) DrawHollowLine ¶
func (captcha *CaptchaImage) DrawHollowLine() *CaptchaImage
DrawHollowLine 添加一个较粗的空白直线
func (*CaptchaImage) DrawLine ¶
func (captcha *CaptchaImage) DrawLine(num int) *CaptchaImage
DrawLine 画一条直线.
func (*CaptchaImage) DrawNoise ¶
func (captcha *CaptchaImage) DrawNoise(complex CaptchaComplex) *CaptchaImage
DrawNoise 画噪点.
func (*CaptchaImage) DrawSineLine ¶
func (captcha *CaptchaImage) DrawSineLine() *CaptchaImage
DrawSineLine 画一条曲线.
func (*CaptchaImage) DrawText ¶
func (captcha *CaptchaImage) DrawText(text string) *CaptchaImage
DrawText 写字.
func (*CaptchaImage) DrawTextNoise ¶
func (captcha *CaptchaImage) DrawTextNoise(complex CaptchaComplex) *CaptchaImage
DrawTextNoise 画文字噪点.
func (*CaptchaImage) SaveImage ¶
func (captcha *CaptchaImage) SaveImage(w io.Writer, imageFormat ImageFormat) error
SaveImage 保存图片对象
type ImageFormat ¶
type ImageFormat int
const ( //图片格式 ImageFormatPng ImageFormat = iota ImageFormatJpeg ImageFormatGif )
Click to show internal directories.
Click to hide internal directories.