BarcodeInfo.cs
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
using System;
using System.Drawing;
namespace CameraVisionLib.Model
{
/// <summary>
/// 条码信息,1DBarcode、2DBarcode
/// </summary>
public class BarcodeInfo
{
/// <summary>
/// 文本
/// </summary>
public string Text { get; set; }
/// <summary>
/// 条码类型
/// </summary>
public string CodeType { get; set; }
/// <summary>
/// 中心点
/// </summary>
public PointF Center { get; set; }
/// <summary>
/// 角度,3点钟方向0°,逆时针为正,顺时针为负。
/// </summary>
public float Angle { get; set; }
/// <summary>
/// 条码尺寸大小
/// </summary>
public SizeF Size { get; set; }
/// <summary>
/// 原点垂直于经过中心点的直线的距离
/// </summary>
public float Distance { get; set; }
/// <summary>
/// 副本,深拷贝
/// </summary>
/// <returns></returns>
public BarcodeInfo Clone()
{
BarcodeInfo node = new();
System.Reflection.PropertyInfo[] info1 = node.GetType().GetProperties();
System.Reflection.PropertyInfo[] info2 = GetType().GetProperties();
for (int i = 0; i < info1.Length; i++)
info1[i].SetValue(node, info2[i].GetValue(this));
return node;
}
}
}