CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2005
    Posts
    478

    Animated GIF Encoding Library

    Before I go and storm through the gif89a docs to create an animated gif encoder, is there an available C or C++ interface for turning a set of images into frames for an animated gif? I have heard of a mythical GIF89.DLL for the creation of GIF's but I have not found documentation. It only exports these

    DllCanUnloadNow
    DllGetClassObject
    DllGetClassObject
    DllUnregisterServer

    I just want to create some animated GIF's now that the patent has expired!
    Windows XP, Visual Studio 2008, SVN

  2. #2
    Join Date
    Nov 2006
    Location
    Australia
    Posts
    1,569

    Re: Animated GIF Encoding Library

    I've always wanted to make something like that... will your animator be freeware?
    Good judgment is gained from experience. Experience is gained from bad judgment.
    Cosy Little Game | SDL | GM script | VLD | Syntax Hlt | Can you help me with my homework assignment?

  3. #3
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588

    Re: Animated GIF Encoding Library

    That's probably a COM dll, so open it with the OLEViewer to see which COM classes it exports and you can probably use those.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  4. #4
    Join Date
    Aug 2005
    Posts
    478

    Re: Animated GIF Encoding Library

    I can't seem to get too much information out ofv the OLE-COM viewer. I am also not too experienced with COM services or servers or whatever. These interfaces are given

    Object Instances
    Drag and Drop Object
    IAsyncOperation
    IClientSecurity
    IDataObject
    IMarshal
    IMultiQI
    IUnknown

    Object Classes
    Grouped by Object Categories
    ...
    OLE 1.0 Categories
    ...
    COM Library Objects
    ...
    All Objects
    ...

    Application ID's
    Type Libraries
    Interfaces

    I have looked at most of these and they don't seem to do anything special relating to the encoding of GIF images. Um, I want to dig at it more though, where should I look?
    Windows XP, Visual Studio 2008, SVN

  5. #5
    Join Date
    Aug 2005
    Posts
    478

    Re: Animated GIF Encoding Library

    I used a tool to generate a type library and came up with this

    Code:
    #ifndef __Gif89_h_
    #define __Gif89_h_
    
    
    #ifndef __RPC_H__
    #include "rpc.h"
    #endif
    #ifndef __RPCNDR_H__
    #include "rpcndr.h"
    #endif
    #include <ole2.h>
    #ifndef __unknwn_h__
    #include "unknwn.h"
    #endif
    #ifndef __objidl_h__
    #include "objidl.h"
    #endif
    #ifndef __oaidl_h__
    #include "oaidl.h"
    #endif
    #ifndef __ocidl_h__
    #include "ocidl.h"
    #endif
    
    DEFINE_GUID(LIBID_Gif89, 0x28d47522,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    /*
    Gif89 1.0
    */
    
    /* forward declares */
    struct IGif89a;
    
    
    
    
    
    DEFINE_GUID(CLSID_Gif89a, 0x28d47530,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    
    #ifndef LCC_IGif89a_DEFINED
    #define LCC_IGif89a_DEFINED
    
    DEFINE_GUID(IID_IGif89a, 0x28d4752f,0xcf84,0x11d1,0x83, 0x4c, 0x0, 0xa0, 0x24, 0x9f, 0xc, 0x28);
    
    typedef interface IGif89a IGif89a;
    
    #undef INTERFACE
    #define INTERFACE IGif89a
    
    DECLARE_INTERFACE_(INTERFACE, IDispatch)
    {
    	HRESULT (STDMETHODCALLTYPE *QueryInterface)(IGif89a *This, GUID* riid, void** ppvObj);
    	ULONG (STDMETHODCALLTYPE *AddRef)(IGif89a *This);
    	ULONG (STDMETHODCALLTYPE *Release)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(IGif89a *This, UINT* pctinfo);
    	HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(IGif89a *This, UINT itinfo, ULONG lcid, void** pptinfo);
    	HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(IGif89a *This, GUID* riid, char** rgszNames, UINT cNames, ULONG lcid, LONG* rgdispid);
    	HRESULT (STDMETHODCALLTYPE *Invoke)(IGif89a *This, LONG dispidMember, GUID* riid, ULONG lcid, USHORT wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
    	HRESULT (STDMETHODCALLTYPE *put_Enabled)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_Enabled)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *get_Window)(IGif89a *This, LONG *);
    	HRESULT (STDMETHODCALLTYPE *Play)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *Stop)(IGif89a *This);
    	HRESULT (STDMETHODCALLTYPE *get_AutoStart)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_AutoStart)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_Speed)(IGif89a *This, LONG *);
    	HRESULT (STDMETHODCALLTYPE *put_Speed)(IGif89a *This, LONG);
    	HRESULT (STDMETHODCALLTYPE *get_Glass)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_Glass)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *put_AutoSize)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_AutoSize)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *get_Embed)(IGif89a *This, VARIANT_BOOL *);
    	HRESULT (STDMETHODCALLTYPE *put_Embed)(IGif89a *This, VARIANT_BOOL);
    	HRESULT (STDMETHODCALLTYPE *get_FileName)(IGif89a *This, BSTR *);
    	HRESULT (STDMETHODCALLTYPE *put_FileName)(IGif89a *This, BSTR);
    	HRESULT (STDMETHODCALLTYPE *AboutBox)(IGif89a *This);
    };
    
    #define IGif89a_QueryInterface(ip, p1, p2) (ip)->lpVtbl->QueryInterface(ip, p1, p2)
    #define IGif89a_AddRef(ip, p1) (ip)->lpVtbl->AddRef(ip, p1)
    #define IGif89a_Release(ip, p1) (ip)->lpVtbl->Release(ip, p1)
    #define IGif89a_GetTypeInfoCount(ip, p1) (ip)->lpVtbl->GetTypeInfoCount(ip, p1)
    #define IGif89a_GetTypeInfo(ip, p1, p2, p3) (ip)->lpVtbl->GetTypeInfo(ip, p1, p2, p3)
    #define IGif89a_GetIDsOfNames(ip, p1, p2, p3, p4, p5) (ip)->lpVtbl->GetIDsOfNames(ip, p1, p2, p3, p4, p5)
    #define IGif89a_Invoke(ip, p1, p2, p3, p4, p5, p6, p7, p8) (ip)->lpVtbl->Invoke(ip, p1, p2, p3, p4, p5, p6, p7, p8)
    #define IGif89a_put_Enabled(ip, p1) (ip)->lpVtbl->put_Enabled(ip, p1)
    #define IGif89a_get_Enabled(ip, p1) (ip)->lpVtbl->get_Enabled(ip, p1)
    #define IGif89a_get_Window(ip, p1) (ip)->lpVtbl->get_Window(ip, p1)
    #define IGif89a_Play(ip) (ip)->lpVtbl->Play(ip)
    #define IGif89a_Stop(ip) (ip)->lpVtbl->Stop(ip)
    #define IGif89a_get_AutoStart(ip, p1) (ip)->lpVtbl->get_AutoStart(ip, p1)
    #define IGif89a_put_AutoStart(ip, p1) (ip)->lpVtbl->put_AutoStart(ip, p1)
    #define IGif89a_get_Speed(ip, p1) (ip)->lpVtbl->get_Speed(ip, p1)
    #define IGif89a_put_Speed(ip, p1) (ip)->lpVtbl->put_Speed(ip, p1)
    #define IGif89a_get_Glass(ip, p1) (ip)->lpVtbl->get_Glass(ip, p1)
    #define IGif89a_put_Glass(ip, p1) (ip)->lpVtbl->put_Glass(ip, p1)
    #define IGif89a_put_AutoSize(ip, p1) (ip)->lpVtbl->put_AutoSize(ip, p1)
    #define IGif89a_get_AutoSize(ip, p1) (ip)->lpVtbl->get_AutoSize(ip, p1)
    #define IGif89a_get_Embed(ip, p1) (ip)->lpVtbl->get_Embed(ip, p1)
    #define IGif89a_put_Embed(ip, p1) (ip)->lpVtbl->put_Embed(ip, p1)
    #define IGif89a_get_FileName(ip, p1) (ip)->lpVtbl->get_FileName(ip, p1)
    #define IGif89a_put_FileName(ip, p1) (ip)->lpVtbl->put_FileName(ip, p1)
    #define IGif89a_AboutBox(ip) (ip)->lpVtbl->AboutBox(ip)
    
    #endif // LCC_IGif89a_DEFINED
    
    
    
    
    #endif // Gif89_h_
    Windows XP, Visual Studio 2008, SVN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured