Пример #1
0
 /// <summary>
 /// 比较两个对象的数据
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public bool EqualsValue(JumpPrintInfo info)
 {
     if (info == null)
     {
         return(false);
     }
     if (info == this)
     {
         return(true);
     }
     return(info.bolEnabled == this.bolEnabled &&
            info.intNativePosition == this.intNativePosition &&
            info.intPosition == this.intPosition &&
            info.myPage == this.myPage);
 }
Пример #2
0
        /// <summary>
        /// 绘制续打区域
        /// </summary>
        /// <param name="g">图形绘制对象</param>
        /// <param name="ClipRectangle">剪切矩形</param>
        /// <param name="Position">续打位置</param>
        /// <param name="FillColor">填充色</param>
        protected void DrawJumpPrintArea(
            System.Drawing.Graphics g,
            System.Drawing.Rectangle ClipRectangle,
            JumpPrintInfo Position,
            System.Drawing.Color FillColor)
        {
            if (Position == null || Position.Page == null || Position.Enabled == false)
            {
                return;
            }

            MultiPageTransform trans = ( MultiPageTransform )this.myTransform;

            int pos = -1;

            foreach (SimpleRectangleTransform item in trans)
            {
                if (item.ContentStyle == PageContentPartyStyle.Body &&
                    item.PageObject == Position.Page)
                {
                    pos = item.UnTransformPoint(0, Position.Position + ( int )item.DescRectF.Top).Y;
                }
            }
            if (pos < 0)
            {
                return;
            }
            //int pos = trans.UnTransformY( Position );

            if (pos >= 0)
            {
                System.Drawing.Rectangle rect = new System.Drawing.Rectangle(
                    0,
                    0,
                    this.ClientSize.Width,
                    pos);

                System.Drawing.Rectangle rect2 = ClipRectangle;
                if (ClipRectangle.IsEmpty)
                {
                    rect2 = rect;
                }
                else
                {
                    rect2 = System.Drawing.Rectangle.Intersect(rect, rect2);
                }
                if (!rect2.IsEmpty)
                {
                    g.ResetClip();
                    g.PageUnit = System.Drawing.GraphicsUnit.Pixel;
                    g.ResetTransform();
                    using (System.Drawing.SolidBrush b = new System.Drawing.SolidBrush(FillColor))
                    {
                        g.FillRectangle(b, rect2);
                    }
                    using (System.Drawing.Pen p =
                               new System.Drawing.Pen(System.Drawing.Color.Blue, 2))
                    {
                        g.DrawLine(
                            p,
                            0,
                            rect.Bottom - 1,
                            this.ClientSize.Width,
                            rect.Bottom - 1);
                    }
                }
            }
        }