40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace DataMatrix4Net
|
|||
|
|
{
|
|||
|
|
public class MyBitMatrix : Gma.QrCodeNet.Encoding.BitMatrix
|
|||
|
|
{
|
|||
|
|
///
|
|||
|
|
/// Public interface
|
|||
|
|
///
|
|||
|
|
public override int Width { get { return width; } }
|
|||
|
|
public override int Height { get { return height; } }
|
|||
|
|
public override bool[,] InternalArray { get { return internalArray; } }
|
|||
|
|
///
|
|||
|
|
public override bool this[int i, int j]
|
|||
|
|
{
|
|||
|
|
get { return (i >= 0 && j >= 0 && i < width && j < height) ? internalArray[i, j] : false; }
|
|||
|
|
set { if (i >= 0 && j >= 0 && i < width && j < height) internalArray[i, j] = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
///
|
|||
|
|
/// Private members
|
|||
|
|
///
|
|||
|
|
readonly int width;
|
|||
|
|
readonly int height;
|
|||
|
|
readonly bool[,] internalArray;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Public constructor
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="width">Matrix width</param>
|
|||
|
|
/// <param name="height">Matrix height</param>
|
|||
|
|
public MyBitMatrix(int width, int height)
|
|||
|
|
{
|
|||
|
|
this.width = width;
|
|||
|
|
this.height = height;
|
|||
|
|
internalArray = new bool[width, height];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|