I have a C#/GDI+ paint application (winform) in which I draw different shapes with different colors and pen sizes. Now, the shape drawing I have handled, but using a 'free pen' as you would in MS Paint, I have also had it done but it is rather ugly (see pic).

if (crtanje)
                    debljina = float.Parse(debljina_box.Text);
                    Graphics gr = Graphics.FromImage(bit);
                    gr.SmoothingMode = SmoothingMode.HighQuality;
                    olovka = new Pen(boja, debljina);
                    gr.DrawLine(olovka, new Point(prethodnoX ?? e.X, prethodnoY ?? e.Y), new Point(e.X, e.Y));
                    panel1.CreateGraphics().DrawImageUnscaled(bit, new Point(0, 0));
                    prethodnoX = e.X;
                    prethodnoY = e.Y;
(Meaning of most variables can be deduced but I can explain if necessary.)

My app works that firstly I draw images on a bitmap (called 'bit' in this case), which are then created on a panel and then the panel paint event shows what I have drawn. But in this case, the pen is quite ugly, I assume because of the procedure: create graphics-draw line-draw on panel takes some time in between steps.

Is there a way to make this smoother?

Name:  a.jpg
Views: 280
Size:  43.0 KB