Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange compression/deformation when drawing concentric circles #75

Open
chris-crowther opened this issue May 9, 2022 · 1 comment
Open

Comments

@chris-crowther
Copy link

chris-crowther commented May 9, 2022

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".

image

@zgabi
Copy link

zgabi commented Jul 1, 2022

The bigger circles are not even drawn:
image

After changing all the ints to long in DrawEllipseCentered:
image

I changed the following:
image

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants