 |
|
 |
Great work, even after 10 years.
I have used the old Microsoft Gif Animator (MGA) to convert a CamStudio (CS) *avi file to a *.gif file. This works just fine in the CS and MGA applications, but when I try to load it into your program, it runs but doesnt load the file. nres = m_Animation.LoadAnimatedGif("my.gif"); returns 0. Your animation54.gif is 17 KB while my.gif is 93,049 KB. Header mark on both animations54.gif and my.gif is 'GIF89a'. Any idea what's going on here. Is my file just too big? Is there some specific dimension or file size that is required to work?
Thanks again for this nifty little program.
Edit: Tried again with an 8 frame gif of 384 KB. Still not able to load the file. Must be some restrictions on the file size that I don't understand. Any help greatly appreciated.
modified 4 Nov '11.
|
|
|
|
 |
|
 |
I find TerminateThread function in the source code to stop the animation, it will cause memory leak, I do not think it is a good code there.
|
|
|
|
 |
|
 |
The "ApplyTransparency" routine doesn't do the job. What it does is copy pixels from the first frame into transparent areas of all subsequent frames, so the solid block around the first frame shows in all of them.
A better solution is given in my reply to the article "Add GIF-Animation to your MFC and ATL Projects" on CodeGuru:
http://www.codeguru.com/Cpp/G-M/bitmap/article.php/c4879
Hope you find this helpful.
-- Jim
|
|
|
|
 |
|
 |
memory leaks!
|
|
|
|
 |
|
 |
winimage.cpp
line 563 GlobalColorMap = new COLOR [1<<GlobalBPP];
memory allocate here seems don't have a delete.
so here is the place where memory leaks,
just modify here will fix this.
I will do it later.
|
|
|
|
 |
|
 |
thanks ,but gif ctrl can't be transparent,i think it is so hard,because the back ground...
|
|
|
|
 |
|
 |
generally,the project is nice and impressive.
Two points I want to present as follows:
1 you'd better talk us clearly that line 2 in GifAnimation.cpp should be rectify according to our project name,for example #include "gifDemo.h" in my project. My project'name is gifDemo.
2 m_Animation is either play or stop.so, if we use the method of LoadAnimatedGif("animation54.gif") in OnInitDialog and we do not call the play method immediately, there are going to be memory error.
|
|
|
|
 |
|
 |
Thank you for this very nice work.
I have been having some trouble getting Play and Stop to run as independent threads. For example, I have a method triggered by clicking on a button called OnGetKey(). The method is supposed to display text in a textbox and display a CGifAnimation m_progressCtrl. The code works just fine until I attempt to insert another function, or in the example below, some time-dependent method, in which case the CGifAnimation m_progressCtrl doesnt display the gif at all until the Sleep (or whatever) has run it's course.
I believe that CGifAnimation uses independent thread to Play. Given that the app itself is granted the primary thread, the Gif Animation should have it's own thread. But there is obviously interference between the two or perhaps some third thread.
void CMyProgressCtrlDlg::OnGetKey()
{
m_infoTextBox.SetWindowTextW(L"Getting Information");
OnPlay();
Sleep(3000);
//OnStop();
}// OnGetKey()
void CMyProgressCtrlDlg::OnPlay()
{
m_progressCtrl.ShowWindow(SW_SHOW);
m_progressCtrl.Play();
}
void CMyProgressCtrlDlg::OnStop()
{
m_progressCtrl.Stop();
m_progressCtrl.ShowWindow(SW_HIDE);
}
Has anyone else encountered this problem? How might I work around it? I really want my animated gif to act as a custom CWaitCurser to indicate to the user that the program is doing something and has not stalled.
|
|
|
|
 |
|
 |
I want to want to change the GIF file depending on a user choice.
|
|
|
|
 |
|
 |
Hi Riazi,
Very nice article. It will be really great if you could find time for my problem
I am having 10 bmp files and i want to make one gif out of that. showing each bmp file one after another like animated gif. and I want to do it using GDI+ in plane C++. How to achieve that?????
|
|
|
|
 |
|
 |
Hi, anybody konws why the ApplyTransparency() function doesn't work. As the authour points out, I import the winimage.cpp and winimage.h files into my project. After compling, the program runs, but the backgroup white color still exits, the ApplyTransparency()doesn't work. Anybody knows why and solutions? Many thanks.
|
|
|
|
 |
|
 |
I have tried to compile the project with UNICODE, _UNICODE directive and it seems like it is not working. Trying to fix the code for Unicode support but any help will be highly appreciated.
|
|
|
|
 |
|
 |
I understood that I have to change winimage.h and winimage.cpp to new files.
But I can't use ApplyTransparency function.
It needs two parameters, but I don't know what should I put for C_Image *pImage.
|
|
|
|
 |
|
 |
Hey guys,
We have used GIF Animation control as described here. The screensaver doesn't come in xp and this results in security issues of the system not being locked.
Take care of this too
venki
|
|
|
|
 |
|
 |
I was used ApplyTransparency() but Image(gif file) doesn't transparent with backgroung color.
doesn't function ApplyTransparency() operate exactly?
|
|
|
|
 |
|
 |
Hi ,
i was reading the article "Taskbar Notification dialog " by John O'Byrne and try figure out , if is possible to create the Animation control inside
that window! It was great !
Can you help to make this ?
Thanks for help
|
|
|
|
 |
|
 |
When I run the original demo project under debug mode, VC notice that memory leak detected. It is true, pls add delete []GlobalColorMap command at the end of this function. (The extended project has done).
|
|
|
|
 |
|
 |
Code in LZWDecoder does not work on Pocket PC (misalignment error), because it cannot work with LONG numbers directly in memory.
Change:
LongCode = *((long*)(bufIn+whichBit/8)); // Get some bytes from bufIn
to
char d1 = *(bufIn+whichBit/8),
d2 = *(bufIn+whichBit/8 + 1),
d3 = *(bufIn+whichBit/8 + 2),
d4 = *(bufIn+whichBit/8 + 3);
LongCode = MAKELONG(MAKEWORD(d1,d2), MAKEWORD(d3,d4));
|
|
|
|
 |
|
 |
Trying to use this on pocket pc and the function SetDIBitsToDevice()
is not supported. What can I do?
Thanks for any infos.
|
|
|
|
 |
|
 |
My project use unicode to support CJK language. The problom is that CGifAnimation::LoadAnimatedGif(LPTSTR FileName) seems to support TCHAR, but the function body calls "C_ImageSet::LoadGIF(char*)" directly. It is incorrect with _UNICODE. What shall I do with UNICODE?
|
|
|
|
 |
|
 |
I'm using your decoder in my project and have noticed that it doesn't decode correctly sometimes.
Take the 1st frame of this GIF and look at the smiley's right eye. There are 2 white pixels that should be black. Your decoder decodes those pixels as 0x00 instead of 0x07.
I was not able to find out what's wrong with the decoder. Could you please help me?
--
www.TimoSoft-Software.de
-- modified at 13:25 Thursday 18th May, 2006
|
|
|
|
 |
|
 |
I used WinImage Library for decoding the GIFs. I didn't know that there is any update for it or not. Must refer to WinImage.
Best regards,
A. Riazi
|
|
|
|
 |
|
 |
Oh, I wasn't aware of this when I wrote my comment. Unfortunately your version of WinImage seems to be the latest. I think I'll write a mail to Juan Soulie.
Thanks
Timo
--
www.TimoSoft-Software.de
|
|
|
|
 |
|
 |
Please inform me if you have any news.
Best regards,
A. Riazi
|
|
|
|
 |
|
 |
I've sent a mail to Juan, but he did not yet reply. However, I finally managed to make this LZW decoder compatible with my app, so I have a working LZW decoder now.
Regards
Timo
--
www.TimoSoft-Software.de
|
|
|
|
 |