Slightly tweaked demo programs for clarity.

pull/39/merge
Project Nayuki 6 years ago
parent 0cded0ba36
commit 55f410cc66

@ -187,7 +187,7 @@ static void doMaskDemo() {
/*---- Utilities ----*/
// Prints the given QR Code to the console.
// Prints the given QrCode object to the console.
static void printQr(const QrCode &qr) {
int border = 4;
for (int y = -border; y < qr.getSize() + border; y++) {

@ -62,7 +62,8 @@ public final class QrCodeGeneratorDemo {
ImageIO.write(img, "png", imgFile); // Write image to file
String svg = qr.toSvgString(4); // Convert to SVG XML code
Files.write(new File("hello-world-QR.svg").toPath(),
File svgFile = new File("hello-world-QR.svg"); // File path for output
Files.write(svgFile.toPath(), // Write image to file
svg.getBytes(StandardCharsets.UTF_8));
}

Loading…
Cancel
Save