System.Drawing.Drawing2D.PathGradientBrush.SetBlendTriangularShape C# (CSharp) Method

SetBlendTriangularShape() public method

public SetBlendTriangularShape ( float focus ) : void
focus float
return void
        public void SetBlendTriangularShape(float focus)
        {
            SetBlendTriangularShape (focus, 1.0F);
        }

Same methods

PathGradientBrush::SetBlendTriangularShape ( float focus, float scale ) : void

Usage Example

Example #1
0
 public void gradient(Point[] points, PathGradientBrush pgbrush, Triangle tre, GraphicsPath brushPath)
 {
     Color[] mySurroundColor = { tre.v1.currColor, tre.v2.currColor, tre.v3.currColor};
     pgbrush.SurroundColors = mySurroundColor;
     int averageR = (tre.v1.currColor.R + tre.v2.currColor.R + tre.v3.currColor.R) / 3;
     int averageG = (tre.v1.currColor.G + tre.v2.currColor.G + tre.v3.currColor.G) / 3;
     int averageB = (tre.v1.currColor.B + tre.v2.currColor.B + tre.v3.currColor.B) / 3;
     Color centerCol = Color.FromArgb((byte) averageR, (byte)averageG, (byte)averageB);
     pgbrush.CenterColor = centerCol;
     pgbrush.SetBlendTriangularShape(0.7f, 0.7f);
     graphics.FillPolygon(pgbrush, points);
     pgbrush.Dispose();
 }
All Usage Examples Of System.Drawing.Drawing2D.PathGradientBrush::SetBlendTriangularShape