qrCodeKit

package
v3.26.152 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(path string) (content string, err error)

Decode 解析二维码(仅支持部分图片).

PS: (1) 能解析 yeqown/go-qrcode 生成的二维码. (2) 不能解析 skip2/go-qrcode 生成的二维码.

func EncodeToFile

func EncodeToFile(content, outputImgPath string, options ...standard.ImageOption) error

EncodeToFile 生成二维码图片.

@param content 二维码的内容 @param options 可以指定: (1) logo(放在二维码的中心)

(2) halftone(比较酷炫),可参考 https://github.com/yeqown/go-qrcode 中: example/with-halftone/README.md
(3) 尺寸(但单位并非像素)
(4) 透明
(5) 前景色、背景色

func Generate deprecated

func Generate(content string, level qrcode.RecoveryLevel, size int) ([]byte, error)

Generate 生成二维码([]byte类型).

Deprecated: 推荐使用 EncodeToFile.

@param content 二维码的内容 @param level 一般使用 qrcode.Medium @param size 二维码的宽高,单位: px @return png图片的字节流

func GenerateWithColor deprecated

func GenerateWithColor(content string, level qrcode.RecoveryLevel, size int, background, foreground color.Color) ([]byte, error)

GenerateWithColor 参考了 qrcode.WriteColorFile.

Deprecated: 推荐使用 EncodeToFile.

Types

This section is empty.

Jump to

Keyboard shortcuts

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