Apparently a DrawingImage
is adjusted to the bounds of the actually drawn geometry. To get around that, you may replace the LineGeometry
by a PathGeometry
that contains the point (0,0)
, but does not draw it:
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure StartPoint="0,0">
<LineSegment Point="50,50" IsStroked="False"/>
<LineSegment Point="100,50"/>
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
Note that StartPoint="0,0"
is the default value. It's just here for clarity.