In a WPF application which currently being developed, user is able to draw lines on canvas and of course after saving it, he can see few different file formats (as output e.g. JPEG and a proprietary file format). This works fine but the JPEG version should be cropped and when this cropping happens, the top side of the object is copped with few extra pixels.
In the code we have used an anti-aliasing setting:
EdgeMode.Aliased;
Base on System.Windows.Media.EdgeMode
See it below. Now, when this is commented out things workout well so no problem with cropping however, the lines get rendered with sharper edges which it is not acceptable.
Has anybody been exposed to this issue? if so, what is the solution or workaround this issue?
#region Assembly PresentationCore.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationCore.dll
#endregion
using System;
namespace System.Windows.Media
{
// Summary:
// Determines how the edges of non-text drawing primitives are rendered.
public enum EdgeMode
{
// Summary:
// No edge mode is specified. Do not alter the current edge mode of non-text
// drawing primitives. This is the default value.
Unspecified = 0,
//
// Summary:
// Render the edges of non-text drawing primitives as aliased edges.
Aliased = 1,
}
}
Thank you