ä»ã®ã¢ããªã«éä¿¡ããæ¹æ³ã¯ããããªæã§è¦ãããããåä¿¡ã®ãµã³ãã«ã¯ãã¾ãè¦ãããªãã£ãã®ã§ã¡ã¢ã£ã¦ããã¾ãã
ããã¼ããã£ã¹ãã¬ã·ã¼ãã¼ã®è¨è¿°ã¯è¡ã£ã¦ããäºãåæã«ãã¤ã³ãã³ããåãåã£ãæããæç²ãã¦ãã¾ãã
ãµã³ãã«ã½ã¼ã¹
// ã¤ã³ãã³ãããBitmapãªãã¸ã§ã¯ããçæ Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); Bitmap bmp = Media.getBitmap(getContentResolver(), uri); // SDã«ã¼ãã®ç´ä¸ã«ç»åãä¿å File picFile = new File(Environment.getExternalStorageDirectory().getPath() + File.separator + "hoge.png"); FileOutputStream stream = new FileOutputStream(picFile); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
ãã®ä»ã®ãã¤ã³ã
ç»åãåãåã以å¤ã®ãã¤ã³ã
SDã«ã¼ãã®ãã£ã¬ã¯ããªãåå¾ãã
Environment.getExternalStorageDirectory()
ç»åï¼Bitmapãªãã¸ã§ã¯ãï¼ããã¡ã¤ã«ã«ä¿åãã
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream)