System.Drawing.Drawing2D.GraphicsPath.ClearMarkers C# (CSharp) Method

ClearMarkers() public method

public ClearMarkers ( ) : void
return void
        public void ClearMarkers()
        {
            // shortcut to avoid allocations
            if (types.Count == 0)
                return;

            var cleared = new List<byte> ();
            byte current = 0;

            for (int i = 0; i < types.Count; i++) {
                current = types [i];

                /* take out the marker if there is one */
                if ((current & (byte)PathPointType.PathMarker) != 0)
                    //current &= ~PathPointType.PathMarker;
                    current &= ((byte)PathPointType.PathMarker ^ 0xff);

                cleared.Add (current);
            }

            /* replace the existing with the cleared array */
            types = cleared;
        }

Usage Example

Exemplo n.º 1
0
 public System.Drawing.Bitmap SetCornerAlpha(System.Drawing.Bitmap pBit)
 {
     System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(pBit);
     new System.Drawing.SolidBrush(EdgeDisplay.alphaColor);
     System.Drawing.Drawing2D.GraphicsPath graphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
     System.Drawing.PointF[] array = new System.Drawing.PointF[4];
     array[0] = new System.Drawing.PointF(0f, 0f);
     array[1] = new System.Drawing.PointF(0f, (float)pBit.Height);
     array[2] = new System.Drawing.PointF((float)pBit.Height, (float)pBit.Height);
     graphicsPath.ClearMarkers();
     graphicsPath.AddPolygon(array);
     graphics.SetClip(graphicsPath);
     graphics.Clear(System.Drawing.Color.Transparent);
     array[0] = new System.Drawing.PointF((float)this.subSize.Width, 0f);
     array[1] = new System.Drawing.PointF((float)(this.subSize.Width - pBit.Height), (float)pBit.Height);
     array[2] = new System.Drawing.PointF((float)(this.subSize.Width + pBit.Height + 1), (float)pBit.Height);
     array[3] = new System.Drawing.PointF((float)(this.subSize.Width + 1), 0f);
     graphicsPath.ClearMarkers();
     graphicsPath.AddPolygon(array);
     graphics.SetClip(graphicsPath);
     graphics.Clear(System.Drawing.Color.Transparent);
     array[0] = new System.Drawing.PointF((float)(this.subSize.Width + this.subSize.Height), 0f);
     array[1] = new System.Drawing.PointF((float)(this.subSize.Width + this.subSize.Height - pBit.Height), (float)pBit.Height);
     array[2] = new System.Drawing.PointF((float)(this.subSize.Width + this.subSize.Height + pBit.Height + 1), (float)pBit.Height);
     array[3] = new System.Drawing.PointF((float)(this.subSize.Width + this.subSize.Height + 1), 0f);
     graphicsPath.ClearMarkers();
     graphicsPath.AddPolygon(array);
     graphics.SetClip(graphicsPath);
     graphics.Clear(System.Drawing.Color.Transparent);
     array[0] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height), 0f);
     array[1] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height - pBit.Height), (float)pBit.Height);
     array[2] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height + pBit.Height + 1), (float)pBit.Height);
     array[3] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height + 1), 0f);
     graphicsPath.ClearMarkers();
     graphicsPath.AddPolygon(array);
     graphics.SetClip(graphicsPath);
     graphics.Clear(System.Drawing.Color.Transparent);
     array[0] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height * 2), 0f);
     array[1] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height * 2 - pBit.Height), (float)pBit.Height);
     array[2] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height * 2 + pBit.Height + 1), (float)pBit.Height);
     array[3] = new System.Drawing.PointF((float)(this.subSize.Width * 2 + this.subSize.Height * 2 + 1), 0f);
     graphicsPath.ClearMarkers();
     graphicsPath.AddPolygon(array);
     graphics.SetClip(graphicsPath);
     graphics.Clear(System.Drawing.Color.Transparent);
     return(pBit);
 }
All Usage Examples Of System.Drawing.Drawing2D.GraphicsPath::ClearMarkers