Android save canvas screen as bitmap

浪尽此生 提交于 2019-12-11 02:19:06

问题


Is there a way to do it? I d like to save the canvas screen as a Bitmap object, and then draw it again, to the screen.


回答1:


You can construct a Canvas passing in a Bitmap onto which the canvas will draw. See http://developer.android.com/reference/android/graphics/Canvas.html#Canvas(android.graphics.Bitmap)

You need to construct a Bitmap appropriately sized to the view into which you want to draw.

Just guessing here, but if you are doing this because you want to draw off screen then draw the bitmap on all at once you might also look at SurfaceHolder/SurfaceView.



来源:https://stackoverflow.com/questions/4673582/android-save-canvas-screen-as-bitmap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!