So I'm making a paint app, and I'm wondering how I can preserve the thickness of lines I draw. So my app uses a list of a list of points of all lines drawn, and draws them all again every time a new line is drawn by the user. Now I have one problem, when I change the pen size, the size of ALL the lines change, as they're all getting redrawn.
My code:
//Create new pen
Pen p = new Pen(Color.Black, penSize);
//Set linecaps for start and end to round
p.StartCap = LineCap.Round;
p.EndCap = LineCap.Round;
//Turn on AntiAlias
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
//For each list of line coords, draw all lines
foreach (List<Point> lstP in previousPoints)
{
e.Graphics.DrawLine(p, lstP[0], lstP[1]);
}
p.Dispose();
I know one can use Pen.Width() to change the pen size during the loop but how can I preserve line widths?