现在的位置: 首页 > 综合 > 正文

cocos2dx教程之CCImage

2018年04月22日 ⁄ 综合 ⁄ 共 683字 ⁄ 字号 评论关闭

class CC_DLL CCImage :public
CCObject

{public:

bool
initWithImageFile(const char *
strPath,
EImageFormat
imageType =
kFmtPng);

bool
initWithImageFileThreadSafe(const char *fullpath,
EImageFormat
imageType =
kFmtPng);

bool
initWithImageData  
。。。。

bool
initWithString 
。。。。

   unsigned char *  
getData()              { return
m_pData; }

   int        
getDataLen()           { return
m_nWidth *
m_nHeight; }

   bool
hasAlpha()                    { return
m_bHasAlpha; }

   bool
isPremultipliedAlpha()         { return
m_bPreMulti; }

   bool
saveToFile(const char *pszFilePath,
bool
bIsToRGB = true);

Protected:

   bool _saveImageToPNG(const
char *
pszFilePath,
bool
bIsToRGB = true);

   bool _saveImageToJPG(const
char *
pszFilePath);

   unsigned char *m_pData;

};

抱歉!评论已关闭.