LibGif For WinCE release V1.0

 基于LibUnGif。我的目标是剥离出一套最小的,支持背景透明的,能在WinCE(PocketPC/SmartPhone)上运行的动画GIF库。

做的工作主要是几方面:
1) 增加了透明支持
2) 去掉了WinCE上不必要的一切函数
3) 写了一个Sample Code

使用方法
1)初始化Gif动画
GifWin gif;   gif.Open(gifContentBuffer, gifContentLen, RGB(0xff, 0xff, 0xff));   delay = gif.NextImage();   SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);  
view plaincopy to clipboardprint?
GifWin gif; gif.Open(gifContentBuffer, gifContentLen, RGB(0xff, 0xff, 0xff)); delay = gif.NextImage(); SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);   GifWin gif; gif.Open(gifContentBuffer, gifContentLen, RGB(0xff, 0xff, 0xff)); delay = gif.NextImage(); SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);
2)显示Gif动画
view plainprint?
WM_TIMER:        gif.Draw(hdc, left, top, right, bottom);        InvalidateRect(hdc, &rect, FALSE);        delay = gif.NextImage();        if (delay <= 0) {             gif.Reset();             delay = gif.NextImage();        }        SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);   view plaincopy to clipboardprint?
WM_TIMER:      gif.Draw(hdc, left, top, right, bottom);      InvalidateRect(hdc, &rect, FALSE);      delay = gif.NextImage();      if (delay <= 0) {           gif.Reset();           delay = gif.NextImage();      }      SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);   WM_TIMER:      gif.Draw(hdc, left, top, right, bottom);      InvalidateRect(hdc, &rect, FALSE);      delay = gif.NextImage();      if (delay <= 0) {           gif.Reset();           delay = gif.NextImage();      }      SetTimer(hWnd, GIF_TIMER_ID, delay, NULL);
3)释放Gif动画
gif.Close();  
view plaincopy to clipboardprint?
gif.Close();   gif.Close();
严格遵循GPL,完整源代码下载: 点击这里下载文件
posted @ 2008-11-28 15:39  googlegis  阅读(188)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub