Example #1
0
        public override void Draw()
        {
            var y = Position.Y;
              var center = Position.X;

              StringObject date = new StringObject(this.graphics, DateText, Font);
              date.SetCenterTop(center, y);
              date.Draw();
              y += date.Size.Height;

              y += DateSpace;
              this.graphics.DrawLine(new Pen(Color.Black, 1), center - LineHalf, y - date.Height, center + LineHalf, y - date.Height);

              StringObject signature = new StringObject(this.graphics, SignatureText, Font);
              signature.SetCenterTop(center, y);
              signature.Draw();
              y += signature.Size.Height;

              StringObject subject = new StringObject(this.graphics, SubjectText, Font);
              subject.SetCenterTop(center, y);
              subject.Draw();
              y += subject.Size.Height;

              y += SignSpace;
              this.graphics.DrawLine(new Pen(Color.Black, 1), center - LineHalf, y - subject.Height, center + LineHalf, y - subject.Height);
        }
Example #2
0
        public double Draw(XGraphics graphics, XRect bounds)
        {
            StringObject stringObject = new StringObject(graphics, Text, Font);

              switch (Alignment)
              {
            case HorizontalAlignment.Left:
              stringObject.SetLeftTop(bounds.Left, bounds.Top);
              break;
            case HorizontalAlignment.Center:
              stringObject.SetCenterTop(bounds.Left + bounds.Width / 2f, bounds.Top);
              break;
            case HorizontalAlignment.Right:
              stringObject.SetRightTop(bounds.Right, bounds.Top);
              break;
              }

              stringObject.Draw();

              return stringObject.Size.Height;
        }