WriteableBitmapEx
WriteableBitmapEx copied to clipboard
Strange compression/deformation when drawing concentric circles
Thanks for the excellent library!
When drawing concentric circles on a wide image using DrawEllipseCentered the outer circles appear compressed/deformed.
using (writeableBitmap.GetBitmapContext())
{
var centreX = (int) (writeableBitmap.Width / 2D);
var centreY = (int) (writeableBitmap.Height / 2D);
for (int i = 1; i <= 100; i++)
{
var radius = i * 50;
writeableBitmap.DrawEllipseCentered(centreX, centreY, radius, radius, ConvertColor(Colors.Red));
}
}
The bitmap is passed to a WPF image control with Stretch="None".

The bigger circles are not even drawn:

After changing all the ints to long in DrawEllipseCentered:

I changed the following:

(I don't know how this type change affects the performance... on a 64 bit CPU it should not be a problem)
NOTE: My screenshots are scaled.. in the original size they are perfect circles.