Problems with PlotLine
Dear code gurus,
I am trying to use the function "PlotLine" but it seems to be enable to correctly connect 2 points with the distance of 1 between them when those points have the same Y coordinate. Below is an example function:
When I execute this program with PWidth of 1, I get a line extending from (X, Y) to (X+1, Y) which is 1 pixel high. However, when PWidth is not 1 (2 or more) I do not get the horizontal extent for the line. It extends in the vertical direction centered around (X, Y) and the length of it is "PWidth".
void DrawMyLine(Graphics G, int X, int Y, float PWidth)
// Specify two points, the second one (P2) is just one pixel
// to the right from P1
Point P1 = new Point(X, Y);
Point P2 = new Point(X+1, Y);
// Create a solid pen with width of PWidth and red color
Pen MyPen = new Pen(Color.Red, PWidth);
G.DrawLine(MyPen, P1, P2);
Does anybody know why???
Thank you for your help.