Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis
Created November 10, 2018 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdyrrahitis/925ea274b52b4383b355f6e8c23094b2 to your computer and use it in GitHub Desktop.
Save gdyrrahitis/925ea274b52b4383b355f6e8c23094b2 to your computer and use it in GitHub Desktop.
// Setting each pixel that was drawn
// back to its previous color
public void Undo()
{
var points = 0;
for (int i = _point.X; i < _point.X + Width; i++)
{
for (int j = _point.Y; j < _point.Y + Height; j++)
{
_bitmap.SetPixel(i, j, _previousState[points++]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment