📄 barcodepdf417.cs
字号:
{ theInt32_12 += 1; } if (theInt32_12 < 3) { theInt32_12 = 3; } if (theInt32_12 > 90) { return null; } else { if (theInt32_12 > this.m_Rows) { this.m_RuntimeRows = ((short) theInt32_12); } else { theInt32_12 = ((int) this.m_Rows); this.m_RuntimeRows = this.m_Rows; } theInt32_8 = (theInt32_12 * datacols); if (theInt32_8 > 928) { return null; } else { while (theInt32_6 < ((theInt32_8 - theInt32_1) - controlBlock.Length)) { theInt32Array1[theInt32_6++] = 900; } for (theInt32_13 = 0; (theInt32_13 < controlBlock.Length); theInt32_13 += 1) { theInt32Array1[theInt32_6++] = controlBlock[theInt32_13]; } theInt32Array1[0] = theInt32_6; theInt32Array1[1] = 902; theInt32Array3 = new int[((uint) theInt32_8)]; for (theInt32_14 = 0; (theInt32_14 < theInt32_8); theInt32_14 += 1) { theInt32Array3[theInt32_14] = theInt32Array1[theInt32_14]; } return theInt32Array3; } } } private void BinaryCompact () { int theInt32_9; int theInt32_8; int theInt32_7; int theInt32_6; int theInt32_5; long theInt64_1; ushort theUInt16_1; ushort[] theUInt16Array1; int theInt32_4; int theInt32_3; int theInt32_2; int theInt32_1; theInt32_1 = 1; for (theInt32_2 = 0; (theInt32_2 <= (this.m_SecurityLevel + 1)); theInt32_2 += 1) { theInt32_1 *= 2; } if ((this.m_Columns < 1) || (this.m_Columns > 30)) { this.m_Columns = 1; } theInt32_3 = 0; theInt32_4 = 0; theUInt16Array1 = new ushort[6]; this.m_CharArray = this.m_Data.ToCharArray (); while ((theInt32_3 + 6) <= this.m_Data.Length) { theInt64_1 = 0L; for (theInt32_5 = 0; ((theInt32_5 < 6) && (theInt32_3 < this.m_Data.Length)); theInt32_5 += 1) { theUInt16_1 = ((ushort) this.m_CharArray[theInt32_3++]); theInt64_1 = ((long) ((theInt64_1 * ((long) 256)) + ((long) theUInt16_1))); } theInt32_6 = 0; while (theInt64_1 > ((long) 0)) { theUInt16Array1[theInt32_6++] = ((ushort) (theInt64_1 % ((long) 900))); theInt64_1 /= 900L; } for (theInt32_7 = (theInt32_6 - 1); (theInt32_7 >= 0); theInt32_7--) { this.encoded_buf[theInt32_4++] = theUInt16Array1[theInt32_7]; } } while (theInt32_3 <= (this.m_Data.Length - 1)) { this.encoded_buf[theInt32_4++] = ((ushort) this.m_CharArray[theInt32_3++]); } this.m_CountAferEncode = ((ushort) ((2 + theInt32_4) + theInt32_1)); L_012B: theInt32_8 = (((int) this.m_CountAferEncode) / this.m_Columns); if ((((int) this.m_CountAferEncode) % this.m_Columns) != 0) { theInt32_8 += 1; } if (theInt32_8 < 3) { theInt32_8 = 3; } if (theInt32_8 > 90) { this.m_Columns = ((short) (this.m_Columns + 1)); if (this.m_Columns <= 90) { goto L_012B; } else { return; } } if (theInt32_8 > this.m_Rows) { this.m_RuntimeRows = ((short) theInt32_8); } else { theInt32_8 = ((int) this.m_Rows); this.m_RuntimeRows = this.m_Rows; } this.m_CountAferEncode = ((ushort) (theInt32_8 * this.m_Columns)); if (((int) this.m_CountAferEncode) <= 928) { while (theInt32_4 < ((((int) this.m_CountAferEncode) - theInt32_1) - 2)) { this.encoded_buf[theInt32_4++] = 900; } this.m_EncodedData[0] = ((ushort) (((int) this.m_CountAferEncode) - theInt32_1)); if ((this.m_Data.Length % 6) != 0) { this.m_EncodedData[1] = 901; } else { this.m_EncodedData[1] = 924; } for (theInt32_9 = 0; (theInt32_9 < theInt32_4); theInt32_9 += 1) { this.m_EncodedData[(theInt32_9 + 2)] = this.encoded_buf[theInt32_9]; } this.CreateEC (); } } private int[] textEncode (string s) { int theInt32_5; int[] theInt32Array2; string theString3; int theInt32_4; int theInt32_3; string theString2; string theString1; bool theBoolean1; int theInt32_2; int theInt32_1; int[] theInt32Array1; theInt32Array1 = new int[1000]; theInt32_1 = 0; theInt32_2 = 0; theBoolean1 = false; theString1 = "A"; theString2 = "A"; theInt32_3 = 0; theInt32_4 = 0; theString3 = "A"; while (theInt32_1 < s.Length) { theInt32_3 = this.findChar (s.Substring (theInt32_1, 1)); theInt32_1 += 1; if (theInt32_3 >= 0) { if ((theString3.CompareTo ("B") == 0) && (theString1.CompareTo ("A") == 0)) { theString1 = "B"; } theString2 = BarcodePDF417.textCodes[theInt32_3, 1]; theInt32_4 = int.Parse (theString2.Substring (1, (theString2.Length - 1))); theString2 = theString2.Substring (0, 1); theBoolean1 = false; if (theString2.CompareTo (theString1) == 0) { theInt32Array1[theInt32_2++] = theInt32_4; theBoolean1 = true; } if ((theString2.CompareTo ("D") == 0) && (! theBoolean1)) { theInt32Array1[theInt32_2++] = 29; theInt32Array1[theInt32_2++] = theInt32_4; theBoolean1 = true; } if (((theString2.CompareTo ("C") == 0) && (theString1.CompareTo ("C") != 0)) && (! theBoolean1)) { theInt32Array1[theInt32_2++] = 28; theInt32Array1[theInt32_2++] = theInt32_4; theBoolean1 = true; theString1 = "C"; } if (((theString2.CompareTo ("B") == 0) && (theString1.CompareTo ("B") != 0)) && (! theBoolean1)) { theInt32Array1[theInt32_2++] = 27; theInt32Array1[theInt32_2++] = theInt32_4; theBoolean1 = true; theString1 = "B"; theString3 = "B"; } if (((theString2.CompareTo ("A") == 0) && (theString1.CompareTo ("A") != 0)) && (! theBoolean1)) { if (theString1.CompareTo ("B") == 0) { theInt32Array1[theInt32_2++] = 27; } if (theString1.CompareTo ("C") == 0) { theInt32Array1[theInt32_2++] = 28; theString3 = "A"; } theInt32Array1[theInt32_2++] = theInt32_4; theBoolean1 = true; theString1 = "A"; } } } if ((theInt32_2 % 2) != 0) { theInt32Array1[theInt32_2++] = 29; } theInt32Array2 = new int[((uint) (theInt32_2 / 2))]; for (theInt32_5 = 0; (theInt32_5 < theInt32_2); theInt32_5 += 1) { if ((theInt32_5 % 2) != 0) { theInt32Array2[(theInt32_5 / 2)] = ((theInt32Array2[((theInt32_5 - 1) / 2)] * 30) + theInt32Array1[theInt32_5]); } else { theInt32Array2[(theInt32_5 / 2)] = theInt32Array1[theInt32_5]; } } return theInt32Array2; } private int findChar (string c) { int theInt32_1; theInt32_1 = 0; L_001E: if (theInt32_1 < BarcodePDF417.textCodes.Length) { if (c.CompareTo (BarcodePDF417.textCodes[theInt32_1, 0]) != 0) { theInt32_1 += 1; goto L_001E; } else { return theInt32_1; } } return -1; } private void DrawBar (short BarWidth, short offset_1, short offset_2, bool is_black) { int theInt32_5; int theInt32_4; int theInt32_3; int theInt32_2; int theInt32_1; theInt32_1 = 0; theInt32_2 = 0; theInt32_3 = 0; theInt32_4 = 0; theInt32_5 = 0; if (! is_black) { goto L_013C; } if (this.m_Orientation == enumOrientation.or0) { theInt32_1 = (this.m_CurrX + this.m_LeftPixels); theInt32_2 = ((this.m_TopMargainPixels + offset_1) + this.m_TopPixels); theInt32_3 = (theInt32_1 + BarWidth); theInt32_4 = ((((theInt32_2 + this.m_BarHeightPixels) + theInt32_5) + offset_2) - offset_1); } else { if (this.m_Orientation == enumOrientation.or90) { theInt32_1 = ((this.m_LeftMargainPixels + offset_1) + this.m_LeftPixels); theInt32_2 = (((this.m_HeightPixels - this.m_CurrX) - BarWidth) + this.m_TopPixels); theInt32_3 = ((((theInt32_1 + this.m_BarHeightPixels) + theInt32_5) + offset_2) - offset_1); theInt32_4 = (theInt32_2 + BarWidth); goto L_011B; } if (this.m_Orientation == enumOrientation.or180) { theInt32_1 = (((this.m_WidthPixels - this.m_CurrX) - BarWidth) + this.m_LeftPixels); theInt32_2 = ((this.m_TopMargainPixels - offset_2) + this.m_TopPixels); theInt32_3 = (theInt32_1 + BarWidth); theInt32_4 = ((((theInt32_2 + this.m_BarHeightPixels) + theInt32_5) + offset_2) - offset_1); goto L_011B; } if (this.m_Orientation == enumOrientation.or270) { theInt32_1 = ((this.m_LeftMargainPixels - offset_2) + this.m_LeftPixels); theInt32_2 = (this.m_CurrX + this.m_TopPixels); theInt32_3 = ((((theInt32_1 + this.m_BarHeightPixels) + theInt32_5) + offset_2) - offset_1); theInt32_4 = (theInt32_2 + BarWidth); } } L_011B: if (! this.m_FirstDraw) { this.g.FillRectangle (this.m_BarBrush, theInt32_1, theInt32_2, (theInt32_3 - theInt32_1), (theInt32_4 - theInt32_2)); } L_013C: this.m_CurrX = ((short) (this.m_CurrX + BarWidth)); } private void DrawChar (string BlackWhitePattern, string NarrowWidePattern, short offset_1, short offset_2) { char theChar2; bool theBoolean1; char theChar1; int theInt32_1; theInt32_1 = 0; goto L_012E; L_012A: theInt32_1 += 1; L_012E: if (theInt32_1 <= (BlackWhitePattern.Length - 1)) { theChar1 = BlackWhitePattern[theInt32_1]; if (theChar1 != 98) { theBoolean1 = false; } else { theBoolean1 = true; } theChar2 = Na
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -