General News Suggestion Question Bug Answer Joke Praise Rant Admin Then the only thing left is that add the two files from the package into your project and that's ok.
Microsoft gif viewer windows#
#include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include // MFC DAO database classes #endif // _AFX_NO_DAO_SUPPORT #include // MFC ODBC database classes #endif // _AFX_NO_DB_SUPPORT #include // MFC Automation classes #endif // _AFX_NO_OLE_SUPPORT
#include // MFC extensions #ifndef _AFX_NO_OLE_SUPPORT #include // MFC core and standard components #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
Microsoft gif viewer code#
Step 1: Set control correspondence in DoDataExchange method of sample dialog:Ĭopy Code // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H_2C6822B8_F873_453B_A37D_24F966BDD5D5_INCLUDED_) G.DrawImage(m_pImage,rcClient.left,rcClient.top,rcClient.Width(), M_iBorderLineWidth,m_iBorderLineWidth,m_iBorderLineWidth) Void CGIFControl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) M_iCurrentFrame = (++ m_iCurrentFrame) % m_FrameCount Because there will be a new delay value Void CGIFControl::OnTimer(UINT_PTR nIDEvent) NOTE HERE: frame-delay values should be multiply by 10 M_pImage- >SelectActiveFrame(&Guid,m_iCurrentFrame)
M_pImage- >GetPropertyItem(PropertyTagFrameDelay,TotalBuffer,m_pItem) M_pItem = (PropertyItem*)malloc(TotalBuffer) UINT TotalBuffer = m_pImage- >GetPropertyItemSize(PropertyTagFrameDelay) PropertyTagFrameDelay is a pre-defined identifier M_FrameCount = m_pImage- >GetFrameCount(&m_pDimensionIDs) StringFromGUID2(m_pDimensionIDs, strGuid, 39)
For gif image, we only care about animation set#0 M_pImage- >GetFrameDimensionsList(m_pDimensionIDs, count) Now we should get the identifiers for the frame dimensions UINT count = m_pImage- >GetFrameDimensionsCount() First of all we should get the number of frame dimensions Void CGIFControl::Load(LPCTSTR sFileName) Copy Code //Here, we load a GIF image file