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 : Wednesday, February 25, 2009 9:50:12 PM(UTC)

pyodok  
pyodok

Groups: Registered
Posts: 8


Hello~~!!
I tried to convert GIF to BMP Using Leadtool Version.15(visual c++ environment)
But I found some problems that converted result.
It succeeded converting the first frame, but next frames showed up just different part from the first frame.
Rest of part showed up like blank background.

It is following the process logic.
====================================================
nRet = L_LoadBitmapList ( szSrc,
   &hList,
   0,
   ORDER_BGR,
   NULL,
   &fileInfo);


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

 memset(tmpBuf, 0x00, sizeof(tmpBuf));
 sprintf(tmpBuf, "%s%02d.%s", szDstBuf, c, szFileExt);
 char2wchar(tmpBuf, szDst);
 nRet = L_SaveBitmap(szDst, &hTmpBitmap, nFormat, 0, nQFactor, NULL);
}
====================================================

So I tried again to combine the second frame positioned the first frame position(playback offset).
But I didn't get the result what I wanted.

This is the following the combine logic.
====================================================
nRet = L_LoadBitmapList ( szSrc,
   &hList,
   0,
   ORDER_BGR,
   NULL,
   &fileInfo);


nRet = L_GetBitmapListCount(hList, &nCount);

for (c = 0; c < (int)nCount; c++)
{
 if(c == 0)
  nRet = L_GetBitmapListItem(hList, c, &hTmpBitmap, sizeof(BITMAPHANDLE));
 else
  nRet = L_GetBitmapListItem(hList, c, &hTmpBitmap2, sizeof(BITMAPHANDLE));

 memset(tmpBuf, 0x00, sizeof(tmpBuf));
 sprintf(tmpBuf, "%s%02d.%s", szDstBuf, c, szFileExt);
 char2wchar(tmpBuf, szDst);
 
 if(c > 0)
 {
  int XDst = hTmpBitmap2.Left;
  int YDst = hTmpBitmap2.Top;
  int YSize = BITMAPHEIGHT(&hTmpBitmap2);
  int XSize = BITMAPWIDTH(&hTmpBitmap2);
  int XSrc = 0;
  int YSrc = 0;
  
  nRet = L_CombineBitmap(&hTmpBitmap, XDst, YDst, XSize, YSize,  &hTmpBitmap2, XSrc, YSrc, CB_SRC_NOP | CB_OP_ADD | CB_DST_0 | CB_RES_NOP);
 }
 nRet = L_SaveBitmap(szDst, &hTmpBitmap, nFormat, nBitPerPixcel, nQFactor, NULL/*&SaveFileOption*/);
}
====================================================

I attached the file that used my test.
And result file what I expect, too.

Thanks for your Help :)

origin GIF File     : green.gif
convert result file : ng/ng_1.bmp, nb_2.bmp
combine result file : combine/out00.BMP, out01.BMP

my expectation result file  : ok/ok_1.bmp, ok_2.bmp

 

 

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 : Wednesday, February 25, 2009 10:06:37 PM(UTC)

pyodok  
pyodok

Groups: Registered
Posts: 8


attath file
pyodok attached the following image(s):
green.gif
 
#3 Posted : Wednesday, March 4, 2009 3:55:06 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Add this line before calling the L_CombineBitmap() function to combine the t images into one:
nRet = L_SetBitmapRgnColor(&hTmpBitmap2, hTmpBitmap2.Transparency, L_RGN_SETNOT);
I am attaching the result image I got.
File Attachment(s):
green.zip (7kb) downloaded 20 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-2024, Yet Another Forum.NET
This page was generated in 0.095 seconds.