Documentation ¶
Index ¶
- type Bilinear
- type BilinearSrc
- type Captcha
- func (c *Captcha) AddFont(path string) error
- func (c *Captcha) AddFontFromBytes(contents []byte) error
- func (c *Captcha) Create(num int, t StrType) (*Image, string)
- func (c *Captcha) SetBkgColor(colors ...color.Color)
- func (c *Captcha) SetDisturbance(d DisturLevel)
- func (c *Captcha) SetFrontColor(colors ...color.Color)
- func (c *Captcha) SetSize(w, h int)
- type DisturLevel
- type Image
- func (img *Image) DrawCircle(xc, yc, r int, fill bool, c color.Color)
- func (img *Image) DrawLine(x1, y1, x2, y2 int, c color.Color)
- func (img *Image) DrawString(font *truetype.Font, c color.Color, str string, fontsize float64)
- func (img *Image) FillBkg(c image.Image)
- func (img *Image) Rotate(angle float64) image.Image
- type StrType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BilinearSrc ¶
type BilinearSrc struct {
// contains filtered or unexported fields
}
type Captcha ¶
type Captcha struct {
// contains filtered or unexported fields
}
func (*Captcha) AddFontFromBytes ¶
AddFontFromBytes allows to load font from slice of bytes, for example, load the font packed by https://github.com/jteeuwen/go-bindata
func (*Captcha) SetBkgColor ¶
Set the background color of the generated captchas
If more than one argument is given the color will be picked randomly among the alternatives each time a new captcha is generated
func (*Captcha) SetDisturbance ¶
func (c *Captcha) SetDisturbance(d DisturLevel)
func (*Captcha) SetFrontColor ¶
type DisturLevel ¶
type DisturLevel int
const ( NORMAL DisturLevel = 4 MEDIUM DisturLevel = 8 HIGH DisturLevel = 16 )
type Image ¶
Image 图片
func (*Image) DrawCircle ¶
DrawCircle 画圆 xc,yc 圆心坐标 r 半径 fill是否填充颜色
func (*Image) DrawLine ¶
DrawLine 画直线 Bresenham算法(https://zh.wikipedia.org/zh-cn/布雷森漢姆直線演算法) x1,y1 起点 x2,y2终点
func (*Image) DrawString ¶
DrawString 写字
Click to show internal directories.
Click to hide internal directories.