对于android来说,/dev/graphics/fb0为空,在4.0和4.3 plantform中测试evnironment,我能读到什么
我找不到任何有关对于android来说,/dev/graphics/fb0为空,在4.0和4.3 plantform中测试evnironment,我能读到什么,android,Android,我找不到任何有关/dev/graphics/fb0的信息,下面是我的代码。在阅读fb0之前,我已经执行了“chmod 777/dev/graphics/fb0”;我的测试环境是安卓4.0、4.3和4.4 下面是我的代码: public static synchronized Bitmap getScreenShotBitmap() { FileInputStream buf = null; try { fbFile = new File(FB0FIL
/dev/graphics/fb0的信息,下面是我的代码。在阅读fb0之前,我已经执行了“chmod 777/dev/graphics/fb0”
;我的测试环境是安卓4.0、4.3和4.4
下面是我的代码:
public static synchronized Bitmap getScreenShotBitmap() {
FileInputStream buf = null;
try {
fbFile = new File(FB0FILE1);
buf = new FileInputStream(fbFile);
dStream=new DataInputStream(buf);
dStream.readFully(piex); //Java NULLPOINTException
dStream.close();
for(int i=0;i<piex.length;i+=2)
{
colors[i/2]= (int)0xff000000 +
(int) (((piex[i+1]) << (16))&0x00f80000)+
(int) (((piex[i+1]) << 13)&0x0000e000)+
(int) (((piex[i]) << 5)&0x00001A00)+
(int) (((piex[i]) << 3)&0x000000f8);
}
return Bitmap.createBitmap(colors, screenWidth,screenHeight,Bitmap.Config.RGB_565);
} catch (FileNotFoundException e) {
LogUtil.e(TAG, "FileNotFoundException error",e);
} catch (IOException e) {
LogUtil.e(TAG, "IOException error",e);
}catch (Exception e) {
LogUtil.e(TAG, "Exception error",e);
}
finally {
if(buf!=null){
try {
buf.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return null;
}
公共静态同步位图getScreenShotBitmap(){
FileInputStream buf=null;
试试{
fbFile=新文件(FB0FILE1);
buf=新文件输入流(fbFile);
数据流=新的数据输入流(buf);
dStream.readFully(piex);//Java NULLPOINTException
dStream.close();
对于(int i=0;i请添加代码而不是图像。我已经添加了关键代码,请您帮助我,thx请添加代码而不是图像。我已经添加了关键代码,请您帮助我,thx