Util

Util Bitmap轉File

PATH = 檔案位址
50 = 品質數0~100

private File saveImage(Bitmap bmp) {
        File file = new File(PATH);
        try {
            FileOutputStream fos = new FileOutputStream(file);
            bmp.compress(Bitmap.CompressFormat.JPEG, 50, fos);
            fos.flush();
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return file;
    }

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *