CodeInfo.cs 1.4 KB
using System;
using System.Drawing;

namespace Asa.Barcode
{
    /// <summary>
    /// 条码信息,1DBarcode、2DBarcode
    /// </summary>
    public class CodeInfo
    {
        /// <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 CodeInfo Clone()
        {
            CodeInfo 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;
        }
    }


}