MCPcopy Create free account
hub / github.com/boombuler/barcode / ExampleEncode

Function ExampleEncode

qr/encoder_test.go:119–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117}
118
119func ExampleEncode() {
120 f, _ := os.Create("qrcode.png")
121 defer f.Close()
122
123 qrcode, err := Encode("hello world", L, Auto)
124 if err != nil {
125 fmt.Println(err)
126 } else {
127 qrcode, err = barcode.Scale(qrcode, 100, 100)
128 if err != nil {
129 fmt.Println(err)
130 } else {
131 png.Encode(f, qrcode)
132 }
133 }
134}

Callers

nothing calls this directly

Calls 3

ScaleFunction · 0.92
EncodeMethod · 0.80
EncodeFunction · 0.70

Tested by

no test coverage detected