CCRenderTexture : about saveBuffer

Hi all I’m trying to save my game screenshot to sd card on my android phone,
I found that to save the screen I can use CCRenderTexture and saveBuffer.
I already figure out how to save the image file with this
bool saveBuffer(const char *szFilePath, int x = 0, int y = 0, int nWidth = 0, int nHeight = 0);

My question is :
where will the be saved id i used this
bool saveBuffer (int format, const char *name, int x=0, int y=0, int nWidth=0, int nHeight=0)
function ?

how can I specify the path ?

thanks for any reply

best regards

You can specify the path by the parameter szFilePath.

thanks for the quick reply Minggo,

but I’m sorry I still don’t understand about it.
In this function :
bool saveBuffer (int format, const char *name, int x=0, int y=0, int nWidth=0, int nHeight=0)

there is no parameter szFilePath

thanks

There is another function:
bool saveBuffer(const char *szFilePath, int x = 0, int y = 0, int nWidth = 0, int nHeight = 0);

thanks Minggo for the reply , I’ll try both of the

I’ve figure out how to save screenshot to SD card
this my code :

//create path
mkdir(“/sdcard/PSFS/”, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);

//render the scene
CCRenderTexture * tex = CCRenderTexture::renderTextureWithWidthAndHeight(size.width, size.height);
tex~~>setPosition);
tex~~>begin();
this~~>visit;
tex~~>end();
char temp[100];
sprintf(temp, “/sdcard/Folder_Name/Filename%d.jpg”, filename);

//save to jpg
const char *file;
file = (const char *)temp;
tex->saveBuffer(file,0,0,0,0);

best regards