Esempio 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;
		}
        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);
        }