Documentation
¶
Index ¶
- Constants
- type Avatar
- type BackgroundImage
- type ForegroundImage
- type Generate
- type IQrCode
- type QrCode
- func (q *QrCode) DefaultCreateAvatar(img image.Image) (image.Image, error)
- func (q *QrCode) DefaultCreateBackgroundImage(img image.Image) (image.Image, error)
- func (q *QrCode) DefaultCreateForegroundImage(img image.Image) (image.Image, error)
- func (q *QrCode) DisableBorder(disable bool)
- func (q *QrCode) Image(size int) (image.Image, error)
- func (q *QrCode) PNG(size int) ([]byte, error)
- func (q *QrCode) SetAvatar(avatar *Avatar)
- func (q *QrCode) SetBackgroundColor(color color.Color)
- func (q *QrCode) SetBackgroundImage(img *BackgroundImage)
- func (q *QrCode) SetCreateAvatar(create Generate)
- func (q *QrCode) SetCreateBackgroundImage(create Generate)
- func (q *QrCode) SetCreateForegroundImage(create Generate)
- func (q *QrCode) SetForegroundColor(color color.Color)
- func (q *QrCode) SetForegroundImage(src string)
- func (q *QrCode) Write(size int, out io.Writer) error
- func (q *QrCode) WriteFile(size int, filename string) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ForegroundImage ¶
type ForegroundImage struct {
Src string
}
type IQrCode ¶
type IQrCode interface {
// 设置头像
SetAvatar(*Avatar)
// 设置背景图
SetBackgroundImage(*BackgroundImage)
// 设置背景颜色
SetBackgroundColor(color.Color)
// 设置前景图
SetForegroundImage(string)
// 设置前景颜色
SetForegroundColor(color.Color)
DisableBorder(bool)
// 返回生成的二维码图片
Image(size int) (image.Image, error)
// 返回 png 二维码图片
PNG(size int) ([]byte, error)
// 将二维码以PNG写入io.Writer
Write(size int, out io.Writer) error
// 将二维码以PNG写入指定的文件
WriteFile(size int, filename string) error
}
type QrCode ¶
type QrCode struct {
Avatar *Avatar
ForegroundImage *ForegroundImage
BackgroundImage *BackgroundImage
CreateBackgroundImage Generate
CreateForegroundImage Generate
CreateAvatar Generate
// contains filtered or unexported fields
}
func (*QrCode) DefaultCreateAvatar ¶
默认创建头像的方法
func (*QrCode) DefaultCreateBackgroundImage ¶
默认创建背景图的方法
func (*QrCode) DefaultCreateForegroundImage ¶
默认创建前景图的方法
func (*QrCode) DisableBorder ¶
func (*QrCode) SetCreateAvatar ¶
func (*QrCode) SetCreateBackgroundImage ¶
func (*QrCode) SetCreateForegroundImage ¶
Click to show internal directories.
Click to hide internal directories.
