I have a picture box with size 432x322. I would like to draw a line from (50, 50) to (382, 272), but the end point turns out outside the picture box. The part of code is:
e.Graphics.DrawLine(new Pen(Brushes.Black, 2), new Point(50, 50), new Point(382, 272));
How to solve this problem? Thanks in advance!