man*_*der 10 wpf geometry xaml shape

我正在尝试使用xaml中的点创建一个多边形,并且根据我的理解,给定点的输出应该是带有黑色填充的三角形,但它返回带有粉色填充的三角形.我不知道这是怎么回事.请告诉我.
Tha xaml就是这样
<Polygon Width="237"
Height="214"
Fill="White"
Stroke="Black"
StrokeThickness="2">
<Polygon.Points>
<Point X="50" Y="50" />
<Point X="150" Y="150" />
<Point X="50" Y="150" />
</Polygon.Points>
</Polygon>
Run Code Online (Sandbox Code Playgroud)
点X = 0和Y = 0位于左上角,而不是左下角.所以图纸是正确的.
获得你想要的是改变你的xaml如下:
<Polygon Width="237"
Height="214"
Fill="Black"
Stroke="White"
StrokeThickness="2">
<Polygon.Points>
<Point X="50" Y="150" />
<Point X="150" Y="150" />
<Point X="150" Y="50" />
</Polygon.Points>
<Polygon>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11693 次 |
| 最近记录: |