Skip to content

Instantly share code, notes, and snippets.

@kswlee
Created July 23, 2013 15:34
Show Gist options
  • Save kswlee/6063354 to your computer and use it in GitHub Desktop.
Save kswlee/6063354 to your computer and use it in GitHub Desktop.
// 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