How to increase speed of rendering in C#?

For the interest and development of C# trying to implement a chess Board(all size shape and form I have on full screen) by drawing on the form, but the result is not very pleasing - much like a chess Board drawn in the boot process.
How can I speed up this? Are there any faster ways of drawing

private void DrawRectangle(int x0, int y0, int x1, int y1, string colohtml)
{
 label1.Visible = false;

 SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(colohtml));
 Graphics formGraphics;
 formGraphics = this.CreateGraphics();
 formGraphics.FillRectangle(myBrush, new Rectangle(x0, y0, x1, y1));
myBrush.Dispose();
formGraphics.Dispose();


}



 private void shahmatSmall()
{
 int h, w, h1, w1, X, Y, kolg, kolh;
 h = this.Height;
 w = this.Width;
 kolg = w / 20;
 kolh = h / 20;

 for (c = 1; c <= kolg+20; c=c+1)
{
 for (d = 1; d <= kolh+20; d=d+1)
{
 X = c*20;
 Y = d * 20;
 if ((c+d)%2==0) 
{
 DrawRectangle(X - 20, Y - 20, X, Y, "#000000");

}
 else 
{
 DrawRectangle(X - 20, Y - 20, X, Y, "#FFFFFF");

}
 } 
 }
July 8th 19 at 12:01
1 answer
July 8th 19 at 12:03
Solution
Redo the code, all this should be done only 1 time:
SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(colohtml));
 Graphics formGraphics;
 formGraphics = this.CreateGraphics();

myBrush.Dispose();
 formGraphics.Dispose();

Can still use double buffering, then render will not be visible, it will occur in memory, then the finished image perrished on the form, and if the graphics in the program in General, "heavy", it makes sense DirectX/OpenGL or WPF (DirectX).

Find more questions by tags C#Programming