Android的保存画布屏幕位图 [英] Android save canvas screen as bitmap

查看:90
本文介绍了Android的保存画布屏幕位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法做到这一点?我倒要画布画面保存为位图对象,然后再绘制,到屏幕上。

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.

推荐答案

您可以构建一个帆布传递一个位图上在画布将绘制。见<一href=\"http://developer.android.com/reference/android/graphics/Canvas.html#Canvas(android.graphics.Bitmap\" rel=\"nofollow\">http://developer.android.com/reference/android/graphics/Canvas.html#Canvas(android.graphics.Bitmap)

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.

只是猜测这里,但如果你这样做是因为要抽出屏幕,然后绘制位图上一下子还可以看看SurfaceHolder / SurfaceView。

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.

这篇关于Android的保存画布屏幕位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆