登录
  • 欢迎访问 Sharezer Blog

Cocos2d-X截屏并保存成png

Cocos sharezer 2502次浏览 已收录 0个评论
RenderTexture* texture = RenderTexture::create(64, 64);
texture->begin();
this->visit();
texture->end();

texture->saveToFile("screen.png");

如上使用RenderTexture创建了64*64的区域。

Win32下在buildDebug.win32 目录下可以找到保存的screen.png.

Cocos2d-X截屏并保存成png

默认从右下角开始截取。


Sharezer , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Cocos2d-X截屏并保存成png
喜欢 (1)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址