Ejemplo n.º 1
0
		internal static RadialGradientShaderFactory GetRadialGradientShaderFactory(RadialGradientPaint radialGradientPaint, float alpha = 1.0f)
		{
			var center = radialGradientPaint.Center;
			float centerX = (float)center.X;
			float centerY = (float)center.Y;
			float radius = (float)radialGradientPaint.Radius;

			var data = GetGradientPaintData(radialGradientPaint, alpha);
			var shader = new RadialGradientData(data.Colors, data.Offsets, centerX, centerY, radius);

			var radialGradientShaderFactory = new RadialGradientShaderFactory(shader);
			return radialGradientShaderFactory;
		}
Ejemplo n.º 2
0
        internal static RadialGradientShaderFactory GetRadialGradientShaderFactory(RadialGradientPaint radialGradientPaint)
        {
            var   center  = radialGradientPaint.Center;
            float centerX = (float)center.X;
            float centerY = (float)center.Y;
            float radius  = (float)radialGradientPaint.Radius;

            var data   = PaintExtensions.GetGradientPaintData(radialGradientPaint);
            var shader = new RadialGradientData(data.Colors, data.Offsets, centerX, centerY, radius);

            var radialGradientShaderFactory = new RadialGradientShaderFactory(shader);

            return(radialGradientShaderFactory);
        }