使用cocos2dx自己的功能就能实现
void ParsePlist::parsePlist(const char *plistName)
{
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(plistName);
std::string path = CCFileUtils::sharedFileUtils()->fullPathForFilename(plistName);
CCDictionary *dict = CCDictionary::createWithContentsOfFileThreadSafe(path.c_str());
CCDictionary *framesDict = (CCDictionary*)dict->objectForKey("frames");
CCDictElement* pElement = NULL;
std::string writePath = CCFileUtils::sharedFileUtils()->getWritablePath();
CCDICT_FOREACH(framesDict, pElement)
{
// CCDictionary* frameDict = (CCDictionary*)pElement->getObject();
std::string spriteFrameName = pElement->getStrKey();
CCSprite* spr = CCSprite::createWithSpriteFrameName(spriteFrameName.c_str());
spr->setAnchorPoint(ccp(0, 0));
CCRenderTexture* render = CCRenderTexture::create(spr->getContentSize().width, spr->getContentSize().height);
render->begin();
spr->visit();
render->end();
std::string filePath = writePath+spriteFrameName;
render->saveToFile(filePath.c_str());
}
}