Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, February 23, 2009 10:59:22 PM(UTC)
iknights

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////


 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, February 24, 2009 6:12:43 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

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

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

File Attachment(s):
test_image.zip (264kb) downloaded 17 time(s).
 
#4 Posted : Wednesday, February 25, 2009 8:59:50 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,028

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.

File Attachment(s):
ResultingBitmaps.zip (236kb) downloaded 18 time(s).
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.064 seconds.