Skip to content

Instantly share code, notes, and snippets.

@eldog
Created August 7, 2011 13:24
Show Gist options
  • Save eldog/1130367 to your computer and use it in GitHub Desktop.
Save eldog/1130367 to your computer and use it in GitHub Desktop.
Saving android canvas
// Save the canvas to file "check.jpg" on SDCard
public void saveCanvas() throws IOException
{
// Write the canvas to file
FileOutputStream fos;
try
{
fos = new FileOutputStream("/sdcard/check.jpg");
mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment