android-studio - 有没有办法从 Android Studio (Intellij) 中的调试控制台保存位图

标签 android-studio intellij-idea

在 android studio 中,您可以通过单击变量旁边的(查看位图)从调试控制台查看位图。我想知道是否有办法将这些保存到您正在使用的计算机上?
Bitmap I'm trying to save

最佳答案

当执行在断点处停止时,有可能评估代码,这允许将代码粘贴到那里,然后可以通过给定的 Bitmap 执行导出处理...假设事件应用程序已被授予写入外部存储的权限。

这将是要粘贴和评估的代码,其中 bitmap是要导出的句柄:

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();
}

这就是它应该看起来的样子:

evaluate code

然后可以使用“设备文件资源管理器”从 /mnt/sdcard 下载导出的图像。 .

关于android-studio - 有没有办法从 Android Studio (Intellij) 中的调试控制台保存位图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37284674/

相关文章:

sql - 在 Idea Intellij 上,如何连接到 Google Cloud SQL

maven-2 - 将 IntelliJ 项目迁移到 Maven 的最佳方法?

android-studio - Gradle Daemon启动无限循环

android - Gradle 失败 - 无法找到方法 com.google.common.io.CharSource.readLines

Android Studio 渲染问题 : The following classes could not be found

java - 用intellij运行java spark

java - 使用 Maven、Jersey 和 Tomcat 8 从 Intellij 运行 REST 服务

maven - 使用IntelliJ打开Gradle项目的源目录,但这是一个Maven项目

android - android中的Highchart渲染缓慢

android - ~/Library/Android/sdk/ndk-bundle 中的 NDK 没有 source.properties 文件