Skip to content

A configurable Quiet Zone size is needed #1

@Lcng

Description

@Lcng

By now, a fixed Quiet Zone size is 4. I edited your code to make it configurable.

And another issue.
The generated tag's width / height's value is the value specified to the constructor of class SvgQRCode, which may result in little blank margin on the right edge and the bottom edge of the image.
So I edited the method Create() of class SvgQRCode as the following:

var unitsPerModule = (int)Math.Floor(size / (double)matrix.ModuleMatrix.Count);
var modeleSize = matrix.ModuleMatrix.Count * unitsPerModule;

var svgFile = new StringBuilder(@"<svg version=""1.1"" baseProfile=""full"" width=""");
svgFile.Append(modeleSize);
svgFile.Append(@""" height=""");
svgFile.Append(modeleSize);

Now the blank edge is gone. But this results in smaller image size..

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions