예제 #1
0
        Fill GetLinearHorizontalFill()
        {
            //Create a linear gradient paint with
            // + mode = horizontal
            // + fill from left to 1/3 of width
            LinearGradient paint = new LinearGradient();
            paint.StartX = 0;
            paint.EndX = w / 3;
            paint.Ramp = GetColorRamp();
            paint.Mode = LinearGradientMode.Horizontal;
            paint.Style = gradientStyle;

            Fill result = new Fill(paint);
            return result;
        }
예제 #2
0
        Fill GetLinearBackwardFill()
        {
            //Create a linear gradient paint with
            // + mode = forward diagonal
            // + start point: (0,0)
            // + end point: (w/2, h/2)

            LinearGradient paint = new LinearGradient();
            paint.StartX = 0;
            paint.StartY = 0;
            paint.EndX = w / 2;
            paint.EndY = h / 2;
            paint.Ramp = GetColorRamp();
            paint.Mode = LinearGradientMode.BackwardDiagonal;
            paint.Style = gradientStyle;

            Fill result = new Fill(paint);
            return result;
        }
예제 #3
0
        Fill GetLinearVerticalFill()
        {
            //Create a linear gradient paint with
            // + mode = vertical
            // + fill from top to 1/2 of height (middle)
            LinearGradient paint = new LinearGradient();
            paint.StartY = 0;
            paint.EndY = h / 2;
            paint.Ramp = GetColorRamp();
            paint.Mode = LinearGradientMode.Vertical;
            paint.Style = gradientStyle;

            Fill result = new Fill(paint);
            return result;
        }