save screenshot
2023. 3. 14. 19:07ㆍcocos2dx
//save screenshot
time_t rawtime;
struct tm* timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
Size screenSize = CCDirector::sharedDirector()->getWinSize();
auto tex = CCRenderTexture::create(screenSize.width, screenSize.height);
tex->setPosition(ccp(screenSize.width / 2, screenSize.height / 2));
tex->begin();
visit();
tex->end();
tex->saveToFile(ccsf("Image_Save_%02d_%02d_%02d.png", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec), Image::Format::PNG);
저장되는 루트는 c:\사용자\계정이름\AppData\Local\실행파일명\ 에 저장된다(default route)
'cocos2dx' 카테고리의 다른 글
particle/using action function (0) | 2023.03.14 |
---|---|
clipping node (0) | 2023.03.14 |
async loading (0) | 2023.03.14 |
opencv -cocos2dx 연결 (0) | 2023.03.14 |
win build 테두리 없애기 (0) | 2023.03.14 |