Return bitmap from CCRenderTexture

Return bitmap from CCRenderTexture
0.0 0



I am taking screen shots of the after game complete need to post on facebook, I have save in game phone memory but the operation of saving file is too much taking time around 3.5 there any way to get the bitmap from CCRenderTexture so that i can save the time.

my code

             _CCRenderTexture * tex = CCRenderTexture::create(winSize.width,
         tex->setPosition(ccp(winSize.width/2, winSize.height/2));
         //save to jpg
        const char *file;
        file = "DB_Screenshot.jpeg";
        bool status;
                status = tex-> saveToFile(file, kCCImageFormatJPEG);_

Thank you.


You can refer to CCRenderTexture::saveToFile(const char *fileName, tCCImageFormat format), instead of dealing with bitmap in your code.
Please take TestCpp > RenderTexture Test> “Save Image” in top-right corner as a sample.


What about loading the saved file? TestCPP only creates the image from the current CCRenderTexture.
And I’ve tried CCImage::initWithFile(“the_file.png”), CCSprite::create(“the_file.png”);
Those searches file in Assets folder in Android. So not available.

Does anyone knows how to load the image file saved by SaveToFile method?

Thanks in advance.