public void printScreen(View view) {
String imgPath = "/storage/emulated/0/Pictures/test.png";
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap bitmap = view.getDrawingCache();
if (bitmap != null) {
try {
FileOutputStream out = new FileOutputStream(imgPath);
bitmap.compress(Bitmap.CompressFormat.PNG, 100,
out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Captura de pantalla de desarrollo de Android un control
Supongo que te gusta
Origin blog.csdn.net/qq_35761934/article/details/121794870
Recomendado
Clasificación