This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, February 23, 2009 10:59:22 PM(UTC)
Groups: Registered
Posts: 2
Hello.
I use LeadTools version 15 from a c environment and I try to convert files in .gif format to .bmp.
I'v converted some gif to bmp.
However, the first gif page was just converted. The others was not converted (Image color and size).
I attach the source and sample image.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
nRet = L_LoadBitmapList ( szSrc,
&hList,
0,
ORDER_BGR,
NULL,
&fileInfo);
if (nRet < 1) return nRet;
nRet = L_GetBitmapListCount(hList, &nCount);
if (nRet < 1 ) return nRet;
for (c = 0; c < (int)nCount; c++)
{
nRet = L_GetBitmapListItem(hList, c, &hTmpBitmap, sizeof(BITMAPHANDLE));
if(nRet != SUCCESS)
{
L_DestroyBitmapList(hList);
return nRet;
}
nRet = L_SaveBitmap(szDst, &hTmpBitmap, FILE_BMP, 8, 0, NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#2
Posted
:
Tuesday, February 24, 2009 6:12:43 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I did not find your attachment, please make sure that you put your attached file in a ZIP or RAR file and you do not click on the Preview button before you post your issue to the Forums.
About the problem itself, it could be related to the file, especially if it contained animation.
Also, you are using the same value szDst for the file name inside the loop. Does this mean you are overwriting every time? Keep in mind that BMP format only supports one page in each file.
#3
Posted
:
Tuesday, February 24, 2009 2:54:39 PM(UTC)
Groups: Registered
Posts: 2
Hi.
I missing some code.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for (c = 0; c < (int)nCount; c++)
{
nRet = L_GetBitmapListItem(hList, c, &hTmpBitmap, sizeof(BITMAPHANDLE));
if(nRet != SUCCESS)
{
L_DestroyBitmapList(hList);
return nRet;
}
sprintf(szDst, "Image%02d", c);
nRet = L_SaveBitmap(szDst, &hTmpBitmap, FILE_BMP, 8, 0, NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#4
Posted
:
Wednesday, February 25, 2009 8:59:50 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I tried code similar to yours and it does open the GIF pages correctly. However, when GIF files contain animation, there will be transparency and position information for different frames. This information is not supported by the BMP file format, so the resulting bitmaps might look different.
I'm attaching the correct pages as they are saved by LEADTOOLS.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.