mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 03:43:16 +00:00
db5e084ef9
Move System.Drawing usage out of Core to WinForms, as System.Drawing is not in .NET Core/Standard. Simple methods to return resource name strings have been added instead.
36 lines
905 B
C#
36 lines
905 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
// From: https://github.com/codebude/QRCoder
|
|
namespace QRCoder
|
|
{
|
|
using System;
|
|
|
|
public class QRCodeData : IDisposable
|
|
{
|
|
public List<BitArray> ModuleMatrix { get; set; }
|
|
|
|
public QRCodeData(int version)
|
|
{
|
|
this.Version = version;
|
|
var size = ModulesPerSideFromVersion(version);
|
|
this.ModuleMatrix = new List<BitArray>();
|
|
for (var i = 0; i < size; i++)
|
|
this.ModuleMatrix.Add(new BitArray(size));
|
|
}
|
|
|
|
public int Version { get; private set; }
|
|
|
|
private static int ModulesPerSideFromVersion(int version)
|
|
{
|
|
return 21 + (version - 1) * 4;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
this.ModuleMatrix = null;
|
|
this.Version = 0;
|
|
|
|
}
|
|
}
|
|
}
|