根植設備上的屏幕截圖 我想要捕獲使用APK生根的Android設備的屏幕。 我試過根植設備上的Android屏幕截圖
process = Runtime.getRuntime().exec("/system/bin/screencap -p " + path + 」/file.png 」);
該命令工作正常,但速度太慢。 然後我嘗試使用第二個選項
View content = findViewById(android.R.id.content).getRootView();
content.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(content.getDrawingCache());
OutputStream fout = null;
File imageFile = new File(_path,"ScreenImage.png");
try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout);
fout.flush();
fout.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
但在這我得到我的觀點不應用當前屏幕。 我是捕捉屏幕截圖的製作視頻了出來,我使用FB0進行視頻,但要問題是每秒
請建議的解決方案8幀的速度拍攝畫面加快這一進程。分辨率不是問題,它可能是質量差。
這是活動或服務內的代碼? –
http://stackoverflow.com/questions/14242131/device-specific-screen-capturing-on-android –