我目前有以下代码:
Path path = new Path();
path.Fill = new RadialGradientBrush(Colors.White, Colors.Transparent)
{
GradientOrigin = new Point(.5, .5),
Center = new Point(.5, .5),
RadiusX = 1.5,
RadiusY = 1.5
};
PathGeometry geo = new PathGeometry();
PathFigure figure = new PathFigure();
figure.IsClosed = true;
figure.StartPoint = new Point(10, 10);
figure.Segments.Add(new LineSegment()
{
Point = new Point(20, 20)
});
figure.Segments.Add(new LineSegment()
{
Point = new Point(30, 10)
});
geo.Figures.Add(figure);
path.Data = geo;
Canvas.Children.Add(path);
但它有什么问题呢?什么都没有出现。我期待一个带有白色中心渐变画笔的黑色三角形达到其大小限制。
有人有线索吗?