qrcode

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtJPG = ".jpg"
	ExtPNG = ".png"
	ExtGIF = ".gif"
	ExtBMP = ".bmp"
)

扩展名,支持四种图片二维码生成

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaInfo

type MetaInfo struct {
	Content string // 内容
	Level   qr.ErrorCorrectionLevel
	Mode    qr.Encoding
	Width   int
	Height  int
	Ext     string // 命名扩展名
}

MetaInfo 元信息

func (*MetaInfo) Generate

func (sf *MetaInfo) Generate() (barcode.Barcode, error)

Generate generate to barcode.Barcode

func (MetaInfo) GenerateToBase64

func (sf MetaInfo) GenerateToBase64() (string, string, error)

GenerateToImageB64 generate QR code to base64 string, return base64 string and filename

func (*MetaInfo) GenerateToBytes

func (sf *MetaInfo) GenerateToBytes() ([]byte, string, error)

GenerateToBytes generate to byte

func (*MetaInfo) GenerateToFile

func (sf *MetaInfo) GenerateToFile(path string) (string, error)

GenerateToFile generate QR code, return filename

func (*MetaInfo) GenerateToImageB64

func (sf *MetaInfo) GenerateToImageB64() (string, string, error)

GenerateToImageB64 generate QR code to base images string, return base64 image string and filename base64 images string format like: data: image/png;base64,xxxxxxxxxx

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL