示例#1
0
        private void DoPathEffect(CanvasControl sender, CanvasDrawingSession ds)
        {
            using (var thBuilder = new Microsoft.Graphics.Canvas.Geometry.CanvasPathBuilder(sender))
            {
                var pthConverter = new PathToD2DPathGeometryConverter();

                foreach (var path in _paths)
                {
                    var offset = (float)ExpandAmount / 2;
                    using (var cl = new CanvasCommandList(ds))
                        using (var pthGeo = pthConverter.parse(path, thBuilder))
                        {
                            using (var clds = cl.CreateDrawingSession())
                            {
                                clds.FillGeometry(pthGeo, 0, 0, GlowColor);
                            }

                            _eg.Setup(cl, (float)GlowAmount, GlowColor);
                            ds.DrawImage(_eg.Output, offset, offset);
                            ds.FillGeometry(pthGeo, offset, offset, ((SolidColorBrush)GlowFill).Color);
                        }
                }
            }
        }
示例#2
0
        private void DoPathEffect(CanvasControl sender, CanvasDrawingSession ds )
        {    
            using (var thBuilder = new Microsoft.Graphics.Canvas.Geometry.CanvasPathBuilder(sender))
            {
                var pthConverter = new PathToD2DPathGeometryConverter();

                foreach(var path in _paths)
                {
                    var offset = (float)ExpandAmount / 2;
                    using (var cl = new CanvasCommandList(ds))
                    using (var pthGeo = pthConverter.parse(path, thBuilder))
                    {
                        using (var clds = cl.CreateDrawingSession())
                        {
                            clds.FillGeometry(pthGeo,0,0, GlowColor);
                        }

                        _eg.Setup(cl, (float)GlowAmount, GlowColor);
                        ds.DrawImage(_eg.Output, offset, offset);
                        ds.FillGeometry(pthGeo,offset, offset, ((SolidColorBrush)GlowFill).Color);
                    }
                    
                }

            }
        }