WPF Drawing Paradox
How is it possible, that 2 ellipses with the same Radius where not (visually) with the same Radius?
in the image bellow, Black and Red ellipses has the same RadiusX... but look on the picture!
<GeometryDrawing Brush="Red">
<GeometryDrawing.Pen>
<Pen Brush="Yellow" Thickness="1"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<GeometryGroup>
<EllipseGeometry x:Name="MediumCircle"
Center="0,0" RadiusX="4" RadiusY="4" />
开发者_开发百科 </GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<GeometryGroup>
<EllipseGeometry x:Name="SmallCircle"
Center="0,0" RadiusX="4" RadiusY="2"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
One has a stroked border and the other doesn't. You'll notice the radius lines up with the center of the stroked border.
Looks like the thickness is to blame. Make them the same for both.
I think I found the reply, but not sure... The Thickness of the ellipse goes not totally around the ellipse. If we Set the Thickness to 4 we will see only 2 pixels of ellipse, if we set at 8, we will not see the red circle anymore...
精彩评论