Created
July 23, 2013 15:34
-
-
Save kswlee/6063354 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
// Serialize the pixels | |
int width = _bmp.getWidth(); | |
int [] pixels = new int[width]; | |
for (int h = _bmp.getHeight() - 1; h >= 0; h--) { // reverse scan line | |
_bmp.getPixels(pixels, 0, width, 0, h, width, 1); | |
for (int i = 0; i < width; ++i) | |
pixels[i] = ByteOrder.reverse(pixels[i]); // reverse ARGB as BGRA | |
dosl.write(pixels); | |
} | |
dosl.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment