Documentation ¶
Index ¶
- Constants
- type Avatar
- type BackgroundImage
- type CircleMask
- type ForegroundImage
- type IImage
- type IQrCode
- type QrCode
- func (q *QrCode) Bytes(size int) ([]byte, error)
- func (q *QrCode) DisableBorder(disable bool)
- func (q *QrCode) Image(size int) (image.Image, error)
- func (q *QrCode) SetAvatar(avatar IImage)
- func (q *QrCode) SetBackgroundColor(color color.Color)
- func (q *QrCode) SetBackgroundImage(img IImage)
- func (q *QrCode) SetForegroundColor(color color.Color)
- func (q *QrCode) SetForegroundImage(img IImage)
- func (q *QrCode) SetRound(r int)
- func (q *QrCode) Write(size int, out io.Writer) error
- func (q *QrCode) WriteFile(size int, filename string) error
- type RoundMask
Constants ¶
View Source
const ( // Level L: 7% error recovery. Low = qrcode.Low // Level M: 15% error recovery. Good default choice. Medium = qrcode.Medium // Level Q: 25% error recovery. High = qrcode.High // Level H: 30% error recovery. Highest = qrcode.Highest )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundImage ¶
type CircleMask ¶
type CircleMask struct {
// contains filtered or unexported fields
}
func DefaultCircleMask ¶
func DefaultCircleMask(img image.Image) CircleMask
func NewCircleMask ¶
func (CircleMask) Bounds ¶
func (ci CircleMask) Bounds() image.Rectangle
func (CircleMask) ColorModel ¶
func (ci CircleMask) ColorModel() color.Model
type ForegroundImage ¶
type ForegroundImage struct {
Src string
}
type IQrCode ¶
type IQrCode interface { // 设置生成图像圆角 SetRound(int) // 设置头像 SetAvatar(IImage) // 设置背景图 SetBackgroundImage(IImage) // 设置背景颜色 SetBackgroundColor(color.Color) // 设置前景图 SetForegroundImage(IImage) // 设置前景颜色 SetForegroundColor(color.Color) DisableBorder(bool) // 返回生成的二维码图片字节数组 Bytes(size int) ([]byte, error) // 返回生成的二维码图片 Image(size int) (image.Image, error) // 将二维码以PNG写入io.Writer Write(size int, out io.Writer) error // 将二维码以PNG写入指定的文件 WriteFile(size int, filename string) error }
type QrCode ¶
type QrCode struct { Avatar IImage ForegroundImage IImage BackgroundImage IImage // contains filtered or unexported fields }
func (*QrCode) DisableBorder ¶
type RoundMask ¶
type RoundMask struct {
// contains filtered or unexported fields
}
func (RoundMask) ColorModel ¶
Click to show internal directories.
Click to hide internal directories.