System.Drawing.Graphics.ResetClip C# (CSharp) Method

ResetClip() public method

public ResetClip ( ) : void
return void
        public void ResetClip()
        {
            if (clipSet > 0)
            {

                //Unlike the current path, the current clipping path is part of the graphics state.
                //Therefore, to re-enlarge the paintable area by restoring the clipping path to a
                //prior state, you must save the graphics state before you clip and restore the graphics
                //state after you’ve completed any clipped drawing.
                context.EOClip ();
                context.RestoreState ();

                // We are clobbering our transform when we do the restore.
                // there are probably other one as well.
                applyModelView ();
                clipSet--;
            }
        }

Usage Example

Example #1
1
        protected override void Draw(Graphics g)
        {
            if (points.Count > 2)
            {
                g.SmoothingMode = SmoothingMode.HighQuality;

                if (Config.UseDimming)
                {
                    using (Region region = new Region(regionFillPath))
                    {
                        g.Clip = region;
                        g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
                        g.ResetClip();
                    }
                }

                g.DrawPath(borderPen, regionFillPath);
                g.DrawPath(borderDotPen, regionFillPath);
                g.DrawLine(borderPen, points[points.Count - 1], points[0]);
                g.DrawLine(borderDotPen, points[points.Count - 1], points[0]);
                g.DrawRectangleProper(borderPen, currentArea);
            }

            base.Draw(g);
        }
All Usage Examples Of System.Drawing.Graphics::ResetClip