Search code examples
c#writeablebitmapwriteablebitmapex

WriteableBitmap extension method FillEllipse is creating artifacts on edges of the image


I am using WriteableBitmap with WriteableBitmapEx, specifically FillEllipse method and when I call FillEllipse where portion of the ellipse is drawn outside the image, it causes an artifact on edge of the image.

Some code for illustration:

public WriteableBitmap TestImage { get; set; } = BitmapFactory.New(500, 500);
...
using (TestImage.GetBitmapContext())
{
    TestImage.FillEllipse(-150, 200, -150 + 200, 200 + 200, Colors.Red);
}

Illustration of the issue:

enter image description here

As you can see, the edge of the image vertically next to the drawn circle is red, for some unknown reason. Does anyone has an idea what causes this and how to solve it?

Thanks a lot :)


Solution

  • Also see this issue on the GitHub project site: https://github.com/reneschulte/WriteableBitmapEx/issues/48

    I will take a look when I get a chance.

    [Update 01/13/2020] This is fixed in the latest on GitHub. The NuGet pack will get updated as well. See v1.6.5