i am trying to load a base64 encoded image string to create a sprite. somewhere there seems to be a mistake though because bool ok always returns false. maybe anybody can help me?
here is the code i’m using:
std::string source = “data:image/png;base64,iVBORw0K……”
int len = 0;
unsigned char buffer;
len = base64Decodesource.c_str, source.length, &buffer);
CCImage img = new CCImage();
bool ok = img->initWithImageData(buffer,len);