ARTICLE AD BOX
I'm creating a custom circular button in WinForms. I can successfully draw the circle using DrawEllipse. However, I don't know how to calculate the correct proportional coordinates to draw a scalable checkmark inside the button so that it resizes properly. How can I calculate proportional points for a checkmark so it scales correctly with the button size?
public class MyButton : Button { protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics graphics = e.Graphics; graphics.SmoothingMode = SmoothingMode.AntiAlias; Rectangle rectangle = new Rectangle(); rectangle.Height = 111; rectangle.Width = 100; graphics.FillEllipse(Brushes.White, rectangle); graphics.DrawEllipse(Pens.White, rectangle); } }