Windows/MFC

GDIPLUS Anigif

aucd29 2013. 10. 2. 18:06
[code]void CDlgConnect::DrawGif(void)
{
    CDC* pDC = GetDC();
    Graphics G(pDC->GetSafeHdc());
    Bitmap memBitmap(m_pAniGif->GetWidth(), m_pAniGif->GetHeight());
    Graphics memDC(&memBitmap);

    UINT count            = 0;
    count                = m_pAniGif->GetFrameDimensionsCount();
    GUID *pDimensionIDs = new GUID[count];
    m_pAniGif->GetFrameDimensionsList(pDimensionIDs, count);
    UINT frameCount        = m_pAniGif->GetFrameCount(&pDimensionIDs[0]);
    static UINT uIndex    = 0; // 프레임을 여기서 변경
    m_pAniGif->SelectActiveFrame(&pDimensionIDs[0], uIndex);

    // image frame max count
    if (++uIndex > frameCount - 1)
    {
        uIndex = 0;
    }

    // 0,0 으로 안해놓고 -_- 삽질했다.. 흑..
    memDC.DrawImage(m_pAniGif,0,0,m_pAniGif->GetWidth(), m_pAniGif->GetHeight());
    G.DrawImage(&memBitmap, 88, 53);
    delete[] pDimensionIDs;
}[/code]