【发布时间】:2014-04-10 05:34:16
【问题描述】:
我正在开发一个应用程序,我必须在其中截取应用程序屏幕的屏幕截图 现在我使用下面的代码它不起作用。我是空位图图像
Process sh = Runtime.getRuntime().exec("su", null,null);
OutputStream os = sh.getOutputStream();
os.write(("/system/bin/screencap -p " + "/sdcard/"+ "bs_score_img" +".png").getBytes("ASCII"));
os.flush();
os.close();
sh.waitFor();
String screenShot = Environment.getExternalStorageDirectory().toString()+"/bs_score_img.png";
Log.i("TAG:Score: screenShot path=", screenShot);
Bitmap bmp = BitmapFactory.decodeFile(new File(screenShot).getAbsolutePath());
【问题讨论】:
-
查看link
标签: android