base64 image strings


#1

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);


Embedded Ressource
#2

sorry to bother… forgot to strip the metadata in the beginning of the string


#3

hey , i have same issue please can you help me how strip the metadata in the beginning of the string? @aushilfe444