I need to draw a grid with Graphics class (just crossed lines), and a transparent representation like this picture:

I don’t know any other way than draw every line/rectangle. The performance is bad if the field is wide. Is there any better way to draw these things?
Here is my current code to draw the grid:
private void drawGrid(Graphics pGraphic, int pGridSize)
{
int verticalCount = this.mPicScreen.Width / pGridSize + 1;
int horizontalCount = this.mPicScreen.Height / pGridSize + 1;
Pen p = new Pen(Color.Gray);
// Vertical Lines
for (int i = 0; i < verticalCount; i++)
{
pGraphic.DrawLine(p,
new Point(i * pGridSize, 0),
new Point(i * pGridSize, this.mPicScreen.Height));
}
// Horizontal Lines
for (int i = 0; i < horizontalCount; i++)
{
pGraphic.DrawLine(p,
new Point(0, i * pGridSize),
new Point(this.mPicScreen.Width, i * pGridSize));
}
}
there is a better way: just use a brush
if you need to make a user defined grid size, you can use
if a random one is ok, you find in
already a grid style