我想以编程方式截取我的android应用程序的屏幕截图,它是一个使用openSIPS协议(protocol)的videocalling应用程序。在进行视频通话时,我需要拍摄屏幕截图。我已经尝试过一些东西,但它提供了除视频通话fragment之外的屏幕截图。这是我的尝试:publicstaticBitmaptakeScreenshot(){ViewrootView=mVideoView.getRootView();rootView.setDrawingCacheEnabled(true);//rootView.measure(MeasureSpec.makeMeasureSpec(0,M
我试过了:process=Runtime.getRuntime().exec("su-ccat/dev/graphics/fb0>/sdcard/frame.raw");process.waitFor();但它不起作用。我的设备已获得root权限。我看到很多答案说它需要root访问权限,但没有实际代码来获取帧缓冲区。我也试过glReadPixels()但没有成功。publicvoidTakeScreen(){DisplayMetricsdm=newDisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm)
我正在尝试截取AndroidOpenGL的屏幕截图。我找到的代码如下:ntsize=width*height;ByteBufferbuf=ByteBuffer.allocateDirect(size*4);buf.order(ByteOrder.nativeOrder());glContext.glReadPixels(0,0,width,height,GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,buf);intdata[]=newint[size];buf.asIntBuffer().get(data);buf=null;Bitmapbitmap=Bitma
我正在尝试截取AndroidOpenGL的屏幕截图。我找到的代码如下:ntsize=width*height;ByteBufferbuf=ByteBuffer.allocateDirect(size*4);buf.order(ByteOrder.nativeOrder());glContext.glReadPixels(0,0,width,height,GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,buf);intdata[]=newint[size];buf.asIntBuffer().get(data);buf=null;Bitmapbitmap=Bitma