Let’s say I have 2 points
Point p1 = new Pen(100, 100);
Point p2 = new Pen(200, 150);
And I draw Ellipse for that point with given radius, that the point is in the centre of ellipse.
int radius = 5;
RectangleF rectangle = new RectangleF();
rectangle.Width = radius * 2;
rectangle.Height = radius * 2;
rectangle.X = Convert.ToSingle(p1.X - radius);
rectangle.Y = Convert.ToSingle(p1.Y - radius);
g.FillEllipse(brush, rectangle);
rectangle.X = Convert.ToSingle(p2.X - radius);
rectangle.Y = Convert.ToSingle(p2.Y - radius);
g.FillEllipse(brush, rectangle);
g.DrawLine(pen, p1, p2);
If I draw line between those points, I get line from one centre to other.
At the moment I can live with that, but I would like to make, that line starts at the edge of Ellipse, so it doesn’t go through it. How could I achieve this?
Found answer: