-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathBarcodeResult.cs
More file actions
54 lines (47 loc) · 1.4 KB
/
BarcodeResult.cs
File metadata and controls
54 lines (47 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using ZXing.Common;
namespace MudExtensions
{
/// <summary>
/// The result that used in MudBarcode component to show one of the barcode formats.
/// </summary>
public class BarcodeResult
{
private readonly BitMatrix bitMatrix;
/// <summary>
///
/// </summary>
/// <param name="bitMatrix"></param>
/// <param name="moduleSizeX"></param>
/// <param name="moduleSizeY"></param>
/// <exception cref="ArgumentNullException"></exception>
public BarcodeResult(BitMatrix bitMatrix, int moduleSizeX, int moduleSizeY)
{
this.bitMatrix = bitMatrix ?? throw new ArgumentNullException(nameof(bitMatrix));
ModuleSizeX = moduleSizeX;
ModuleSizeY = moduleSizeY;
}
/// <summary>
///
/// </summary>
public int Columns => bitMatrix.Width;
/// <summary>
///
/// </summary>
public int ModuleSizeX { get; }
/// <summary>
///
/// </summary>
public int ModuleSizeY { get; }
/// <summary>
///
/// </summary>
public int Rows => bitMatrix.Height;
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public bool this[int x, int y] => bitMatrix[x, y];
}
}