コード例 #1
0
        public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle elementBounds)
        {
            graphics.DrawString(engine.ReplaceTokens(Text1), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left, yPos, new StringFormat());

            graphics.DrawString(engine.ReplaceTokens(Text2), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left + 117, yPos, new StringFormat());
        }
コード例 #2
0
 // Print - draw the text...
 public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle elementBounds)
 {
     // draw it...HeaderFont
     //			graphics.DrawString(engine.ReplaceTokens(Text), engine.PrintFont,
     //				engine.PrintBrush, elementBounds.Left, yPos, new StringFormat());
     graphics.DrawString(engine.ReplaceTokens(Text), engine.BlackFont,
                         engine.PrintBrush, elementBounds.Left, yPos, new StringFormat());
 }
コード例 #3
0
        // Print - draw the rule...
        public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle elementBounds)
        {
            // draw a line...
            Pen pen = new Pen(engine.PrintBrush, 1);

//			graphics.DrawLine(pen, elementBounds.Left, yPos + 2,
//				elementBounds.Right, yPos + 2);
            graphics.DrawLine(pen, 0, yPos + 2,
                              300, yPos + 2);
        }
コード例 #4
0
        public float CalculateHeight(PrintEngine engine, Graphics graphics)
        {
            // loop through the print height...
            float height = 0;

            foreach (IPrintPrimitive primitive in _printPrimitives)
            {
                // get the height...
                height += primitive.CalculateHeight(engine, graphics);
            }

            // return the height...
            return(height);
        }
コード例 #5
0
        public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle elementBounds)
        {
            //名称、单价、数量、金额
            graphics.DrawString(engine.ReplaceTokens(Text1), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left, yPos, new StringFormat());

            graphics.DrawString(engine.ReplaceTokens(Text2), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left + 86, yPos, new StringFormat());

            graphics.DrawString(engine.ReplaceTokens(Text3), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left + 86 + 32, yPos, new StringFormat());

            graphics.DrawString(engine.ReplaceTokens(Text4), engine.PrintFont,
                                engine.PrintBrush, elementBounds.Left + 86 + 32 + 30, yPos, new StringFormat());
        }
コード例 #6
0
        // Draw - draw the element on a graphics object...
        public void Draw(PrintEngine engine, float yPos, Graphics graphics, Rectangle pageBounds)
        {
            // where...
            float     height        = CalculateHeight(engine, graphics);
            Rectangle elementBounds = new Rectangle(pageBounds.Left, (int)yPos, pageBounds.Right - pageBounds.Left, (int)height);

            // now, tell the primitives to print themselves...
            foreach (IPrintPrimitive primitive in _printPrimitives)
            {
                // render it...
                primitive.Draw(engine, yPos, graphics, elementBounds);

                // move to the next line...
                yPos += primitive.CalculateHeight(engine, graphics);
            }
        }
コード例 #7
0
 // CalculateHeight - work out how tall the primitive is...
 public float CalculateHeight(PrintEngine engine, Graphics graphics)
 {
     // we're always five units tall...
     return(5);
 }
コード例 #8
0
 // CalculateHeight - work out how tall the primitive is...
 public float CalculateHeight(PrintEngine engine, Graphics graphics)
 {
     // return the height...
     return(engine.BlackFont.GetHeight(graphics));
 }
コード例 #9
0
 public float CalculateHeight(PrintEngine engine, Graphics graphics)
 {
     return(engine.PrintFont.GetHeight(graphics));
 }