示例#1
0
            protected override void OnPaint(PaintEventArgs e)
            {
                base.OnPaint(e);

                if (UIStyleUtils.IsOffice2007Scheme(Config.UIStyle))
                {
                    // draw shadow around page
                    ShadowPaintInfo pi = new ShadowPaintInfo();
                    pi.Graphics  = e.Graphics;
                    pi.Rectangle = FContent.Bounds;
                    pi.Size      = 6;
                    ShadowPainter.Paint2(pi);
                }
            }
示例#2
0
        private void DrawPages(Graphics g)
        {
            if (Disabled)
            {
                return;
            }

            // draw visible pages
            int firstVisible = PreviewPages.FindFirstVisiblePage(Offset.Y);
            int lastVisible  = PreviewPages.FindLastVisiblePage(Offset.Y + ClientSize.Height);

            for (int i = firstVisible; i <= lastVisible; i++)
            {
                Rectangle pageBounds = PreviewPages.GetPageBounds(i);
                pageBounds.Offset(-Offset.X, -Offset.Y);
                ReportPage page = PreparedPages.GetCachedPage(i);

                // draw shadow around page
                ShadowPaintInfo pi = new ShadowPaintInfo();
                pi.Graphics  = g;
                pi.Rectangle = new Rectangle(pageBounds.Left - 4, pageBounds.Top - 4, pageBounds.Width + 4, pageBounds.Height + 4);
                pi.Size      = 5;
                ShadowPainter.Paint2(pi);

                // shift the origin because page.Draw draws at 0, 0
                g.TranslateTransform((int)pageBounds.Left, (int)pageBounds.Top);
                FRPaintEventArgs e = new FRPaintEventArgs(g, Zoom, Zoom, GraphicCache);
                // draw page
                page.Draw(e);

                // draw search highlight
                if (SearchInfo != null && SearchInfo.Visible && SearchInfo.PageNo == i + 1)
                {
                    page.DrawSearchHighlight(e, SearchInfo.ObjNo, SearchInfo.Ranges[SearchInfo.RangeNo]);
                }
                g.ResetTransform();

                // draw border around active page
                if (i == PageNo - 1)
                {
                    Pen borderPen = GraphicCache.GetPen(Preview.ActivePageBorderColor, 2, DashStyle.Solid);
                    pageBounds.Inflate(-1, -1);
                    g.DrawRectangle(borderPen, pageBounds);
                }
            }
        }