I added the following code to a program that uses LEADTOOLS 12.1 headers, LIBs and DLLs and compiled it on a Windows 7 64-bit PC using Visual C++ 6:
+============================================+
BITMAPHANDLE Bitmap = {0};
L_CreateBitmap(&Bitmap, TYPE_CONV, 800, 600, 24, ORDER_BGR,
NULL, //LPRGBQUAD pPalette
TOP_LEFT,
NULL, //L_UCHAR L_FAR*pData
0); //L_UINT32 dwSize
L_FillBitmap(&Bitmap, RGB(255, 130, 180));
L_SaveFile("e:\\Test\\out.png", &Bitmap, FILE_PNG, 24, 2,
0, //L_UINT uFlags
NULL, //FILESAVECALLBACK pfnCallback
NULL, //L_VOID L_FAR * pUserData
NULL); //pSAVEFILEOPTION pSaveOptions
L_UnlockSupport(L_SUPPORT_GIFLZW, "sg8Z2XkjL");
L_SaveFile("e:\\Test\\out.gif", &Bitmap, FILE_GIF, 8, 2,
SAVEFILE_OPTIMIZEDPALETTE,
NULL, //FILESAVECALLBACK pfnCallback
NULL, //L_VOID L_FAR * pUserData
NULL); //pSAVEFILEOPTION pSaveOptions
L_FreeBitmap(&Bitmap);
+============================================+
The program worked and it saved 2 files, one GIF and one PNG. If the same code doesn't work in your project, please send your toolkit serial number to
support@leadtools.com and ask for latest v12 setup and patches.
Important note:
Please do NOT post your serial number here.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.