Created
August 7, 2011 13:24
-
-
Save eldog/1130367 to your computer and use it in GitHub Desktop.
Saving android canvas
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
// 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