Search code examples
wpfdrawingparadox

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!
alt text

<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>

Solution

  • 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...