()
| 117 | } |
| 118 | |
| 119 | func 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 | } |