Exemple #1
0
        private void method_1(Graphics graphics_0, int int_8, int int_9, int int_10, int int_11, string string_0)
        {
            int num  = int_8 + this.int_2;
            int num2 = ((int_9 + int_11) - this.int_3) - SupportClass.GetDescent(this.font_1);

            this.Graphics_0 = graphics_0;
            graphics_0.DrawString(string_0, this.font_0, SupportClass.GraphicsManager.manager.GetBrush(graphics_0), (float)num, (float)(num2 - Convert.ToInt32(this.font_0.GetHeight() * this.float_1)));
        }
Exemple #2
0
        private void method_3(Graphics graphics_0, int int_8, int int_9, int int_10, int int_11, string string_0)
        {
            int descent = SupportClass.GetDescent(this.font_1);
            int num2    = (int_8 + int_10) - this.int_4;
            int num3    = (int_9 + int_11) - this.int_5;

            this.Graphics_0 = graphics_0;
            for (int i = string_0.Length - 1; i >= 0; i--)
            {
                string str  = string_0[i].ToString();
                int    num6 = Convert.ToInt32(graphics_0.MeasureString(str, this.font_1).Width *this.float_1);
                int    num7 = num2 - num6;
                int    num8 = num3 - descent;
                graphics_0.DrawString(str, this.font_0, SupportClass.GraphicsManager.manager.GetBrush(graphics_0), (float)(num7 - this.int_7), (float)(num8 - Convert.ToInt32(this.font_0.GetHeight() * this.float_1)));
                num2  = (num2 - num6) - this.int_5;
                num3 -= ((num6 + this.int_5) * int_11) * 1 / int_10;
            }
        }
Exemple #3
0
 public static void drawText(PdfContentByte pcb, Graphics g, string text, int x, int y, int w, int h, bool wordWrap, bool underLine, int align, int valign, int indent, System.Drawing.Font font, System.Drawing.Color c)
 {
     if ((text != null) && (text.Trim().Length != 0))
     {
         System.Drawing.Font fm = font;
         if (align != PropertyDefine.CA_CENTER)
         {
             if (align != PropertyDefine.CA_LEFT)
             {
                 if (align == PropertyDefine.CA_RIGHT)
                 {
                     w -= indent;
                 }
             }
             else
             {
                 x += indent;
                 w -= indent;
             }
         }
         else
         {
             x += indent;
             w -= indent * 2;
         }
         int num6    = (int)getFontWidth(g, fm, text);
         int ascent  = SupportClass.GetAscent(fm);
         int descent = SupportClass.GetDescent(fm);
         if (!wordWrap)
         {
             if (num6 > w)
             {
                 text = smethod_2(text, fm, w, g);
                 num6 = (int)getFontWidth(g, fm, text);
             }
             int num9 = x;
             if (align == PropertyDefine.CA_CENTER)
             {
                 num9 = x + ((w - num6) / 2);
             }
             else if (align == PropertyDefine.CA_RIGHT)
             {
                 num9 = (x + w) - num6;
             }
             int num10 = (y + h) - ascent;
             if (valign == PropertyDefine.CVA_MIDDLE)
             {
                 num10 = (y + (((h - ascent) - descent) / 2)) + descent;
             }
             else if (valign == PropertyDefine.CVA_BOTTOM)
             {
                 num10 = y + descent;
             }
             smethod_0(pcb, g, text, num9, num10, num9 + num6, num10 - (descent + ascent), font, c);
         }
         else
         {
             ArrayList list   = wrapString(text, fm, w);
             int       height = (int)fm.GetHeight();
             int       num2   = y;
             if (valign == PropertyDefine.CVA_MIDDLE)
             {
                 num2 = y + ((h - (height * list.Count)) / 2);
             }
             else if (valign == PropertyDefine.CVA_BOTTOM)
             {
                 num2 = (y + h) - (height * list.Count);
             }
             if (num2 < y)
             {
                 num2 = y;
             }
             for (int i = list.Count - 1; i >= 0; i--)
             {
                 if (num2 > (y + h))
                 {
                     break;
                 }
                 string s = (string)list[i];
                 if (s.EndsWith("\n"))
                 {
                     s = s.Substring(0, s.Length - 1);
                 }
                 num6 = (int)getFontWidth(g, fm, s);
                 int num5 = x;
                 if (align == PropertyDefine.CA_CENTER)
                 {
                     num5 = x + ((w - num6) / 2);
                 }
                 else if (align == PropertyDefine.CA_RIGHT)
                 {
                     num5 = (x + w) - num6;
                 }
                 int num4 = num2 + ascent;
                 smethod_0(pcb, g, s, num5, num4, num5 + num6, num4 - (descent + ascent), font, c);
                 num2 += height;
             }
         }
     }
 }