The following code will create a transparent bitmap and then draw a white ellipse on it with anti-aliasing.
using(var background = new Bitmap(500, 500))
using (var graphics = Graphics.FromImage(background))
{
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.Clear(Color.Transparent);
graphics.DrawEllipse(new Pen(Color.White, 50), 250, 250, 150, 150);
background.Save("test.png", ImageFormat.Png);
}
The bug I have found is that the anti-aliased pixels around the edge of the ellipse have an unexpected color. They have RGB values of (254,254,254) instead of (255,255,255). Since GDI+ defines transparent as ARGB (0,255,255,255) and white as (255,255,255,255) why am i seeing 254 after blending?