Example #1
0
 public CommonLinearGradientBrush(
     CommonPoint startPoint, CommonPoint endPoint,
     IEnumerable <CommonGradientStop> stops,
     CommonColorInterpolationMode colorInterpolationMode = CommonColorInterpolationMode.SRgbLinearInterpolation,
     CommonBrushMappingMode mappingMode      = CommonBrushMappingMode.RelativeToBoundingBox,
     CommonGradientSpreadMethod spreadMethod = CommonGradientSpreadMethod.Pad,
     double opacity = 1.0)
     : base(stops, colorInterpolationMode, mappingMode, spreadMethod, opacity)
 {
     StartPoint = startPoint;
     EndPoint   = endPoint;
 }
Example #2
0
 public CommonRadialGradientBrush(
     CommonPoint center,
     CommonPoint gradientOrigin,
     double radiusX,
     double radiusY,
     IEnumerable <CommonGradientStop> stops,
     CommonColorInterpolationMode colorInterpolationMode = CommonColorInterpolationMode.SRgbLinearInterpolation,
     CommonBrushMappingMode mappingMode      = CommonBrushMappingMode.RelativeToBoundingBox,
     CommonGradientSpreadMethod spreadMethod = CommonGradientSpreadMethod.Pad,
     double opacity = 1.0)
     : base(stops, colorInterpolationMode, mappingMode, spreadMethod, opacity)
 {
     Center         = center;
     GradientOrigin = gradientOrigin;
     RadiusX        = radiusX;
     RadiusY        = radiusY;
 }
        protected CommonGradientBrush(
            IEnumerable <CommonGradientStop> stops,
            CommonColorInterpolationMode colorInterpolationMode = CommonColorInterpolationMode.SRgbLinearInterpolation,
            CommonBrushMappingMode mappingMode      = CommonBrushMappingMode.RelativeToBoundingBox,
            CommonGradientSpreadMethod spreadMethod = CommonGradientSpreadMethod.Pad,
            double opacity = 1.0)
            : base(opacity)
        {
            if (stops == null)
            {
                throw new ArgumentNullException(nameof(stops));
            }

            GradientStops          = stops.ToArray();
            ColorInterpolationMode = colorInterpolationMode;
            MappingMode            = mappingMode;
            SpreadMethod           = spreadMethod;
        }