Create image from view/screen in Android

后端 未结 1 1329
你的背包
你的背包 2020-12-13 06:43

Is it possible to create a bitmap image from a view or the screen in Android?

相关标签:
1条回答
  • 2020-12-13 07:40

    There are a couple of ways to do it. A simple one is to do the following:

    Bitmap b = Bitmap.createBitmap(theView.getWidth(), theView.getHeight(), Bitmap.Config.ARGB_8888);
    Canvas c = new Canvas(b);
    theView.draw(c);
    
    0 讨论(0)
提交回复
热议问题