private void PixelLight2D_Resize(object sender, EventArgs e)
{
if (this.scaleX == 0 || this.scaleY == 0)
return;
this.overlay = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using (var g = Graphics.FromImage(this.overlay))
using (var p = new Pen(Color.Black))
{
for (int x = this.scaleX - 1; x < Width; x += this.scaleX)
{
g.DrawLine(p, x, 0, x, Height - 1);
}
for (int y = this.scaleY - 1; y < Height; y += this.scaleY)
{
g.DrawLine(p, 0, y, Width - 1, y);
}
}
}