gg_2dcode

package
v0.3.34 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 4 Imported by: 1

README

2dcode

icon

Quick Start

Code below generates a QRCODE using circle shapes with a centered logo image.

Note: Circle shapes may be not readable by standard readers.

package main


func main() {
	generator := gg_2dcode.NewGenerator(commons.BarcodeFormat_QR_CODE)
	bytes, err := generator.Encode("http://www.gianangelogeminiani.me",
		&commons.OptionSize{Width: 300},
		&commons.OptionCircleShapes{},
		&commons.OptionImageLogo{Filename: "./icon.png"})
	if nil != err {
		panic(err)
	}
	_, err = gg.IO.WriteBytesToFile(bytes, "./qrcode.png")
	if nil != err {
		panic(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(format string, data string, options ...interface{}) ([]byte, error)

Types

type IBarCodeGenerator

type IBarCodeGenerator interface {
	Encode(contents string, options ...interface{}) ([]byte, error)
}

func NewGenerator

func NewGenerator(format commons.BarcodeFormat) IBarCodeGenerator

type IBarCodeScanner

type IBarCodeScanner interface {
	Decode(filename string, options ...interface{}) (string, error)
}

func NewScanner

func NewScanner(format commons.BarcodeFormat) IBarCodeScanner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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