private void ClickWindow(Point point, Canvas canvas) { count++; if (count > 10) { return; } Path path = new Path(); //path.Fill = AttachedProperty.GetFillColor(path); path.Stroke = AttachedProperty.GetFillColor(path); path.Opacity = 1 - count * 0.1 >= 0.5 ? 1 - count * 0.1 : 0.5; DropShadowEffect dropShadowEffect = new DropShadowEffect(); dropShadowEffect.BlurRadius = 10; dropShadowEffect.Color = Colors.LightGray; dropShadowEffect.ShadowDepth = 1; dropShadowEffect.Direction = 90; path.Effect = dropShadowEffect; EllipseGeometry ellipseGeometry = new EllipseGeometry(point, 1 + 3 * count, 1 + 3 * count); path.Data = ellipseGeometry; canvas.Children.Add(path); }
//移动鼠标 private void MouseMovePoint(object sender, MouseEventArgs e) { var border = sender as Border; var canvas = border.FindName("canvas") as Canvas; Point point = e.GetPosition(border); canvas.Children.Clear(); Path path = new Path(); path.Fill = AttachedProperty.GetFillColor(path); path.Opacity = 0.35; DropShadowEffect dropShadowEffect = new DropShadowEffect(); dropShadowEffect.BlurRadius = 10; dropShadowEffect.Color = Colors.LightGray; dropShadowEffect.ShadowDepth = 1; dropShadowEffect.Direction = 90; path.Effect = dropShadowEffect; EllipseGeometry ellipseGeometry = new EllipseGeometry(point, 35, 35); path.Data = ellipseGeometry; canvas.Children.Add(path); }