After tracking while saving image , only overlay mask image is saved but background appear blackscreen.
How to save image tracked face with mask image together? I am using below code to save tracked image.
Date now = new Date();
android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now);
try {
// image naming and path to include sd card appending name you choose for file
String mPath = Environment.getExternalStorageDirectory().toString() + "/Pictures/Screenshots/" + now + ".jpg";
View v1 = view.getRootView();
v1.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
File imageFile = new File(mPath);
FileOutputStream outputStream = new FileOutputStream(imageFile);
int quality = 100;
bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);
outputStream.flush();
outputStream.close();
MediaScannerConnection.scanFile(this,
new String[]{imageFile.toString()}, null,
new MediaScannerConnection.OnScanCompletedListener() {
public void onScanCompleted(String path, Uri uri) {
Log.i("ExternalStorage", "Scanned " + path + ":");
Log.i("ExternalStorage", "-> uri=" + uri);
}
});
} catch (Throwable e) {
// Several error may come out with file handling or OOM
e.printStackTrace();
}
After tracking while saving image , only overlay mask image is saved but background appear blackscreen. How to save image tracked face with mask image together? I am using below code to save tracked image.