Family Birthday Celebration

It has been raining whole day. I have tried to make weather pictures nicer. When I clipped image into circle like the code below shows, result was ugly, without anti-aliasing.

GraphicsPath path = new GraphicsPath();
path.AddEllipse(0, 0, width, height);
graphics.SetClip(path);
graphics.DrawImage(img, 0, 0);

I tried to set anti-aliasing for graphics, but it didn't help.

graphics.SmoothingMode = SmoothingMode.HighQuality; // or SmoothingMode.AntiAlias
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.InterpolationMode = InterpolationMode.High;

Here's final trick how to make circle nicer, just add extra circle.

// Anti-aliasing "fix"
graphics.DrawEllipse(new Pen(Color.White, 3), new Rectangle(0, 0, width, height));

Check below how new weather pictures looks like. Main weather picture goes from WWO, it's only converted into circle shape and temperature circle is generated. There is always space for improvement, but for now I'm happy with the result.

Here are again few pictures from today:


Back