ОА
Size: a a a
ОА
NR
🌙
ОА
MH
a
a
MH
a
a
MH
MH
MH
a
ᅠ
private fun saveImageFromCamera(myBitmap: Bitmap): String {
val bytes = ByteArrayOutputStream()
myBitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes)
val wallpaperDirectory = File(
(Environment.getExternalStorageState()).toString() + IMAGE_DIRECTORY)
// have the object build the directory structure, if needed.
Log.d("fee", wallpaperDirectory.toString())
if (!wallpaperDirectory.exists()) {
wallpaperDirectory.mkdirs()
}
try {
Log.d("heel", wallpaperDirectory.toString())
val f = File(wallpaperDirectory, ((Calendar.getInstance()
.timeInMillis).toString() + ".jpg"))
f.createNewFile()
val fo = FileOutputStream(f)
fo.write(bytes.toByteArray())
MediaScannerConnection.scanFile(requireContext(),
arrayOf(f.path),
arrayOf("image/jpeg"), null)
fo.close()
Log.d("TAG", "File Saved::--->" + f.absolutePath)
return f.absolutePath
} catch (e1: IOException) {
e1.printStackTrace()
}
return ""
}
DM

MH
ᅠ
a
ᅠ