Created
January 5, 2012 15:54
-
-
Save johl/1565824 to your computer and use it in GitHub Desktop.
This file contains 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
f = fopen (filename, "ab"); /* reopen in binary append mode */ | |
for (y = height - 1; y >= 0; y--) | |
{ | |
for (x = 0; x < width; x++) | |
{ | |
i = (y * width + x) * 4; | |
printf ("i is now: %i\n", i); | |
if (ptr != 0) | |
{ | |
fputc (ptr[i + 2], f); /* write blue */ | |
fputc (ptr[i + 1], f); /* write green */ | |
fputc (ptr[i], f); /* write red */ | |
} | |
} | |
} | |
fclose (f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment