表面视图作为android中的位图 [英] Surface view as a bitmap in android

查看:42
本文介绍了表面视图作为android中的位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 cocos2d.

I'm using cocos2d.

现在我已经在图层中添加了一些图像,并进行了一些操作.

Now I've added some images in the layer, and played around a bit.

我正在尝试将整个屏幕保存为图像文件.

I'm trying to save the whole screen as image file.

我该怎么做?

推荐答案

据我了解,cocos2d-android 也有一个带有 saveBuffer 方法的 CCRenderTexture 类.在这种情况下 有看看我的 CCRenderTexture 演示程序和博客文章 cocos2d-iphone,它为您提供了如何使用 CCRenderTexture 和 saveBuffer 创建屏幕截图的示例.相同的原理应该适用于 cocos2d-android.

It is my understanding that cocos2d-android also has a CCRenderTexture class with the saveBuffer method. In that case have a look at my CCRenderTexture demo program and blog post for cocos2d-iphone which gives you an example for how to create a screenshot using CCRenderTexture and saveBuffer. The same principle should be applicable to cocos2d-android.

这篇关于表面视图作为android中的位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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