Esempio n. 1
0
        Fill GetRadialFocalFill()
        {
            //Create a radial gradient paint with
            // + Center point is at the center of viewing region
            // + Different radius X, radius Y
            // + Focal point is near the top-left of viewing region
            RadialGradient paint = new RadialGradient();
            paint.CenterX = w / 2;
            paint.CenterY = h / 2;
            paint.FocusX = w / 4;
            paint.FocusY = h / 2.5;
            paint.RadiusX = w / 3;
            paint.RadiusY = h / 3;
            paint.Style = gradientStyle;
            paint.Ramp = GetColorRamp();

            //create fill and return result
            Fill result = new Fill(paint);
            return result;
        }
Esempio n. 2
0
        Fill GetRadialCircleFill()
        {
            //Create a radial gradient paint with
            // + Center point and Focal point is at the center of viewing region
            // + Radius X = Radius Y
            RadialGradient paint = new RadialGradient();
            paint.CenterX = w / 2;
            paint.CenterY = h / 2;
            paint.FocusX = w / 2;
            paint.FocusY = h / 2;
            paint.Radius = Math.Min(w, h) / 3;
            paint.Style = gradientStyle;
            paint.Ramp = GetColorRamp();

            //create fill and return result
            Fill result = new Fill(paint);
            return result;
        }