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

Edge() public method

public Edge ( PointF v1, PointF v2, PointF v3, PointF origin, Color color ) : AppKit
v1 System.Drawing.PointF
v2 System.Drawing.PointF
v3 System.Drawing.PointF
origin System.Drawing.PointF
color System.Drawing.Color
return AppKit
            public Edge(PointF v1, PointF v2, PointF v3, PointF origin, Color color)
            {
                var ax = (int)v1.X;
                var ay = (int)v1.Y;
                var bx = (int)v2.X;
                var by = (int)v2.Y;
                var cx = (int)origin.X;
                var cy = (int)origin.Y;

                // Edge setup
                A = (int)Math.Floor((decimal)ay) - (int)Math.Floor((decimal)by);
                B = (int)Math.Floor((decimal)bx) - (int)Math.Floor((decimal)ax);
                C = ax * by - ay * bx;

                // Step deltas - This is setup here in case we want to process more than 1 x 1 pixel groups
                StepX = A * StepXSize;
                StepY = B * StepYSize;
                VertexFactor = 1.0f / ((bx - ax) * ((int)v3.Y - ay) - (by - ay) * ((int)v3.X - ax));
                // x/y values for initial pixel block
                int x = (int)origin.X;
                int y = (int)origin.Y;

                EdgeOrigin = A * x + B * y + C;

                Color = color;
            }
PathGradientBrush.Edge