Reputation: 736
I am trying to replicate a very simple image using a path in WPF, but somehow the path does not produce the results I expect.
This is the Image I want
This is the Path I use
<Path Stroke="Black" StrokeThickness="1" Data="M0,2 L2,4 L6,0"
SnapsToDevicePixels="True" RenderOptions.EdgeMode="Aliased" />
This gets returned
How is this possible?
Upvotes: 0
Views: 50
Reputation: 128136
I've added a green line through the coordinates you are drawing, which makes it obvious why you get that output.
You should draw the lower point at the center of a pixel, e.g. like this:
<Path Data="M0,2 L2.5,4.5 L7,0" .../>
Upvotes: 2