public enum Code39Model
{
/// <summary>
/// 基本类别 1234567890ABC
/// </summary>
Code39Normal,
/// <summary>
/// 全ASCII方式 +A+B 来表示小写
/// </summary>
Code39FullAscII
}
/// <summary>
/// 获得条码图形
/// </summary>
/// <param>文字信息</param>
/// <param>类别</param>
/// <param>是否增加前后*号</param>
/// <returns>图形</returns>
public Bitmap GetCodeImage(string p_Text, Code39Model p_Model, bool p_StarChar)
{
string _ValueText = "";
string _CodeText = "";
char[] _ValueChar = null;
switch (p_Model)
{
case Code39Model.Code39Normal:
_ValueText = p_Text.ToUpper();
break;
default:
_ValueChar = p_Text.ToCharArray();
for (int i = 0; i != _ValueChar.Length; i++)
{
if ((int)_ValueChar[i] >= 97 && (int)_ValueChar[i] <= 122)
{
_ValueText += "+" + _ValueChar[i].ToString().ToUpper();
}
else
{
_ValueText += _ValueChar[i].ToString();
}
}
break;
}
_ValueChar = _ValueText.ToCharArray();
if (p_StarChar == true) _CodeText += m_Code39["*"];