如何在WinForms,GDI +中绘制和填充像素完美的对称椭圆?

JBe*_*rer 8 c# gdi+ winforms

我需要绘制(并填充)像素完美,非反对称的对称椭圆.

我已经试过的各种组合InterpolationMode,SmoothingModePixelOffsetMode,但在所有的大小没有我曾尝试做出肯定的椭圆对称停留和非组合的抗alised.

不幸的是,有关该主题的MSDN文档不是很准确.

椭圆在所有尺寸上都不对称

用于绘图的代码:

g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.SmoothingMode = SmoothingMode.None;
g.PixelOffsetMode = PixelOffsetMode.None;                                
g.DrawEllipse(new Pen(colorPalette.SelectedColor), rect);
Run Code Online (Sandbox Code Playgroud)

填充非反椭圆椭圆也是如此.

有谁知道这方面的解决方案?

Lef*_*eff 2

试试这个,够完美吗?:)

e.Graphics.InterpolationMode = InterpolationMode.Bilinear;
e.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
e.Graphics.SmoothingMode = SmoothingMode.None;
e.Graphics.FillEllipse(Brushes.Black, rect);
Run Code Online (Sandbox Code Playgroud)