Android: creating a Bitmap with SurfaceView content

后端 未结 3 1983
甜味超标
甜味超标 2020-12-03 08:29

I\'m afraid to already have the unfortunate answer to this question but just in case... I\'m using a SurfaceView to do some image processing with bitmaps (lights and colors

3条回答
  •  伪装坚强ぢ
    2020-12-03 09:25

    Can you draw your SurfaceView onto a Canvas that's backed by a Bitmap?

        // be sure to call the createBitmap that returns a mutable Bitmap
        Bitmap b = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); 
        Canvas c = new Canvas(b);
        yourSurfaceView.draw(c);
    

提交回复
热议问题