Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created February 13, 2019 17:39
Show Gist options
  • Select an option

  • Save unitycoder/3aa637b9d16bed2da7bb0cf334cb549f to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/3aa637b9d16bed2da7bb0cf334cb549f to your computer and use it in GitHub Desktop.
Draw Grid Pattern in For Loop
for (int x = 0; x < 16; x++)
{
for (int y = 0; y < 16; y++)
{
byte v = (byte)(((x % 2) == (y % 2)) ? 255 : 0);
c.Red = v;
c.Green = v;
c.Blue = v;
c.Alpha = 32;
SetPixel(targetBitmap, x, y, (int)c.ColorBGRA);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment