Taking screen shot of a SurfaceView in android

后端 未结 4 968
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 19:30

I am using following method to taking screen shot of a particular view which is a SurfaceView.

public void takeScreenShot(View surface_view){

    // create          


        
4条回答
  •  星月不相逢
    2020-12-09 20:11

    Try using this one

    Bitmap b = Bitmap.createBitmap(width , height, Bitmap.Config.ARGB_8888);  
    v.setDrawingCacheEnabled(false);            
    v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height);
    v.draw(c);
    

提交回复
热议问题