In android studio you can view bitmaps from the debug console by clicking next to the variable (view bitmap). I was wondering if there was a way to save these to the computer your working on?
there is the possibility to evaluate code, when having the execution halted at a break-point, which permits pasting code into there, which may then perform the export by given Bitmap
handle ... assuming the active application has already been granted permission to write to external storage.
this would be the code to paste and evaluate, where bitmap
is the handle to export:
try {
FileOutputStream output = new FileOutputStream(new File(Environment.getExternalStorageDirectory().toString(), "test.jpg"));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, output);
output.flush();
output.close();
} catch (Exception e) {
e.printStackTrace();
}
and this is how it should look alike:
the exported image can then be downloaded with the "Device File Explorer" from /mnt/sdcard
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With