我有一個生成簽名的應用程序。它採用JOT格式: http://aspn.activestate.com/ASPN/CodeDoc/JOT/JOT/GD.htmlJavascript/HTML如何將JOT格式的內容更改爲GIF格式
如何編寫JavaScript函數將其轉換爲GIF格式。
我已經給出了這個C例子,但我不知道如何轉換它。
謝謝。
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);
}
}
當你在這個級別工作時,你不能只做一個從C到JavaScript的映射。它們是爲完全不同的事物而設計的。 – Skilldrick 2010-07-08 09:57:42