Skip to content

Instantly share code, notes, and snippets.

@blam23
Created March 12, 2012 18:20
Show Gist options
  • Save blam23/2023764 to your computer and use it in GitHub Desktop.
Save blam23/2023764 to your computer and use it in GitHub Desktop.
Get portion of image stored in 1d
for(int y = portion.y; y < portion.height+portion.y; y++)
{
for(int x = portion.x; x < portion.width+portion.x; x++)
{
int pixelPos = (x*image.width) + y;
image.pixelData[pixelPos] = Color.Black;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment