Created
February 13, 2019 17:39
-
-
Save unitycoder/3aa637b9d16bed2da7bb0cf334cb549f to your computer and use it in GitHub Desktop.
Draw Grid Pattern in For Loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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