How do I draw a line from one end to another, how do I control it's length and direction?
I have been testing by changing values but it's giving me random results, I do not want to guess, I want to understand the concept so I know what I'm doing.
This is my code below.
Pen blackPen = new Pen(Color.Black, 1);
Point p1 = new Point(20, 30);
Point p2 = new Point(10, 10);
e.Graphics.DrawLine(blackPen,p1,p2);
Please let me know if you need any more information. thank you.
EDITED:
Apologies for such a broad question:
I have used this code and this draws a line from bottom to across the screen, I want to reduce it's length that is going upwards. please use this code.
graphics is in mm.
Pen blackPen = new Pen(Color.Black, 1);
Point p1 = new Point( 110, 80 );
Point p2 = new Point(240 , 20 );