CCSize size = CCDirector::sharedDirector()->getWinSize();
CCRenderTexture* screen = CCRenderTexture::create(size.width, size.height);
CCScene* temp = CCDirector::sharedDirector()->getRunningScene();
screen->begin();
temp->visit();
screen->end();
screen->saveToFile("cocos2d-x.png", kCCImageFormatPNG);
std::string fullpath = CCFileUtils::sharedFileUtils()->getWritablePath();
CC_SAFE_DELETE(screen);
CCLog("path=%s",fullpath.c_str());