J'ai une application qui génère des signatures. Il est au format JOT: http://aspn.activestate.com/ASPN/CodeDoc/JOT/JOT/GD.htmlJavascript/HTML Comment changer quelque chose qui est au format JOT au format GIF
Comment écrire une fonction JavaScript pour le convertir en format GIF.
On m'a donné cet exemple C, mais je ne sais pas comment le convertir.
Merci.
void doJot2Gif(PODSObject *podsObj,const char* pBase64Data,const char* pFilename)
{
int len = (int)(strlen(pBase64Data));
if (len > 0) {
// make a copy of the JOT data
unsigned char* ptrBuff = (unsigned char*)malloc(len+1);
memset(ptrBuff,0,len+1);
strcpy((char*)ptrBuff,pBase64Data);
// append the GIF extension to the filename
char gif_filepath[256];
strcpy(gif_filepath,pFilename);
strcat(gif_filepath,".GIF");
HANDLE hFile = FILE_OPEN((char*)gif_filepath);
if (hFile == INVALID_HANDLE_VALUE) {
return;
}
// call the routine that converts the JOT to the GIF and writes the file
jottogif((unsigned char*)ptrBuff, hFile);
free(ptrBuff);
FILE_CLOSE(hFile);
}
}
Vous ne pouvez pas faire un mappage de C vers JavaScript lorsque vous travaillez à ce niveau. Ils sont conçus pour des choses complètement différentes. – Skilldrick