Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.