【发布时间】:2013-02-19 16:25:36
【问题描述】:
我能够获得 android framebuffer。但我不知道如何将这些原始字节转换为 jpg 图像文件。如果我尝试使用 java bufferedImage.setpixel 方法在我的笔记本电脑上绘制图像。我得到不正确的彩色图像
Process sh = Runtime.getRuntime().exec("su", null,null);
OutputStream os = sh.getOutputStream();
os.write("/system/bin/cat /dev/graphics/fb0 > /sdcard/img.raw".getBytes());
os.flush();
os.close();
sh.waitFor();`
【问题讨论】:
-
我只是指出不建议尝试以这种方式捕获屏幕内容。即使您是根用户,也有可能根本不支持此功能的设备。参见例如this post by one of the NDK developers at Google
标签: java android framebuffer