Skip to content

A configurable Quiet Zone size is needed #1

Open

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..

Activity

  1. dlemstra commented on Nov 17, 2016

    @dlemstra
    Owner

    I have applied your fix and pushed a new version to NuGet. Will need to figure out how to make the quiet zone configurable this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions