Esempio n. 1
0
 private void OnPrePaint(PaintEventArgs2 e)
 {
     if (PrePaint != null)
     {
         PrePaint(this, e);
     }
 }
Esempio n. 2
0
 private void OnPainted(PaintEventArgs2 e)
 {
     if (Painted != null)
     {
         Painted(this, e);
     }
 }
Esempio n. 3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (this.surface != null)
            {
                PdnRegion   clipRegion = null;
                Rectangle[] rects      = this.realUpdateRects;

                if (rects == null)
                {
                    clipRegion = new PdnRegion(e.Graphics.Clip, true);
                    clipRegion.Intersect(e.ClipRectangle);
                    rects = clipRegion.GetRegionScansReadOnlyInt();
                }

                if (this.justPaintWhite > 0)
                {
                    PdnGraphics.FillRectangles(e.Graphics, Color.White, rects);
                    Invalidate();
                }
                else
                {
                    foreach (Rectangle rect in rects)
                    {
                        if (e.Graphics.IsVisible(rect))
                        {
                            PaintEventArgs2 e2 = new PaintEventArgs2(e.Graphics, rect);
                            OnPaintImpl(e2);
                        }
                    }
                }

                if (clipRegion != null)
                {
                    clipRegion.Dispose();
                    clipRegion = null;
                }
            }

            if (this.justPaintWhite > 0)
            {
                --this.justPaintWhite;
            }

            base.OnPaint(e);
        }
Esempio n. 4
0
        private void OnPaintImpl(PaintEventArgs2 e)
        {
            using (Surface doubleBuffer = GetDoubleBuffer(e.ClipRectangle.Size))
            {
                using (RenderArgs renderArgs = new RenderArgs(doubleBuffer))
                {
                    OnPrePaint(e);
                    DrawArea(renderArgs, e.ClipRectangle.Location);
                    OnPainted(e);

                    IntPtr tracking;
                    Point  childOffset;
                    Size   parentSize;
                    doubleBuffer.GetDrawBitmapInfo(out tracking, out childOffset, out parentSize);

                    PdnGraphics.DrawBitmap(e.Graphics, e.ClipRectangle, e.Graphics.Transform,
                                           tracking, childOffset.X, childOffset.Y);
                }
            }
        }
Esempio n. 5
0
        private void OnPaintImpl(PaintEventArgs2 e)
        {
            using (Surface doubleBuffer = GetDoubleBuffer(e.ClipRectangle.Size))
            {
                using (RenderArgs renderArgs = new RenderArgs(doubleBuffer))
                {
                    OnPrePaint(e);
                    DrawArea(renderArgs, e.ClipRectangle.Location);
                    OnPainted(e);

                    IntPtr tracking;
                    Point childOffset;
                    Size parentSize;
                    doubleBuffer.GetDrawBitmapInfo(out tracking, out childOffset, out parentSize);

                    PdnGraphics.DrawBitmap(e.Graphics, e.ClipRectangle, e.Graphics.Transform,
                        tracking, childOffset.X, childOffset.Y);
                }
            }
        }
Esempio n. 6
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (this.surface != null)
            {
                PdnRegion clipRegion = null;
                Rectangle[] rects = this.realUpdateRects;
                
                if (rects == null)
                {
                    clipRegion = new PdnRegion(e.Graphics.Clip, true);
                    clipRegion.Intersect(e.ClipRectangle);
                    rects = clipRegion.GetRegionScansReadOnlyInt();
                }

                if (this.justPaintWhite > 0)
                {
                    PdnGraphics.FillRectangles(e.Graphics, Color.White, rects);
                }
                else
                {
                    foreach (Rectangle rect in rects)
                    {
                        if (e.Graphics.IsVisible(rect))
                        {
                            PaintEventArgs2 e2 = new PaintEventArgs2(e.Graphics, rect);
                            OnPaintImpl(e2);
                        }
                    }
                }

                if (clipRegion != null)
                {
                    clipRegion.Dispose();
                    clipRegion = null;
                }
            }

            if (this.justPaintWhite > 0)
            {
                --this.justPaintWhite;
            }

            base.OnPaint(e);
        }
Esempio n. 7
0
 private void OnPrePaint(PaintEventArgs2 e)
 {
     if (PrePaint != null)
     {
         PrePaint(this, e);
     }
 }
Esempio n. 8
0
 private void OnPainted(PaintEventArgs2 e)
 {
     if (Painted != null)
     {
         Painted(this, e);
     }
 }
Esempio n. 9
0
        /// <summary>
        /// Before the SurfaceBox paints itself, we need to make sure that the document's composition is up to date
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SurfaceBox_PrePaint(object sender, PaintEventArgs2 e)
        {
            try
            {
                UpdateComposition(true);
            }

            catch (ObjectDisposedException ex)
            {
                Tracing.Ping(ex.ToString());
            }
        }