Пример #1
0
        public void ApplyFilter(SvgVisualElement element, SvgRenderer renderer)
        {
            this.Buffer.Clear();
            this.PopulateDefaults(element, renderer);

            IEnumerable <SvgFilterPrimitive> primitives = this.Children.OfType <SvgFilterPrimitive>();

            if (primitives.Count() > 0)
            {
                foreach (var primitive in primitives)
                {
                    this.Buffer.Add(primitive.Result, (e, r) => primitive.Process());
                }

                // Render the final filtered image
                renderer.DrawImageUnscaled(this.Buffer.Last().Value(element, renderer), new Point(0, 0));
            }
        }
Пример #2
0
        public void ApplyFilter(SvgVisualElement element, SvgRenderer renderer)
        {
            this.Buffer.Clear();
            this.PopulateDefaults(element, renderer);

            IEnumerable<SvgFilterPrimitive> primitives = this.Children.OfType<SvgFilterPrimitive>();

            if (primitives.Count() > 0)
            {
                foreach (var primitive in primitives)
                {
                    this.Buffer.Add(primitive.Result, (e, r) => primitive.Process());
                }

                // Render the final filtered image
                renderer.DrawImageUnscaled(this.Buffer.Last().Value(element, renderer), new Point(0, 0));
            }
        }