Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Render SWF files and get a bitmap buffer of those rendering files

0.00/5 (No votes)
30 Mar 2005 1  
Render Flash files and get a bitmap buffer of those rendering files at any time.

Sample Image - Render_Flash.jpg

Introduction

This is an application that uses the ZFLASH lib, and I changed some code to render multiple Flash files at the same time.

Sample Project

Step 1: Declare a variable of the CFlashRender class:

CFlashRender m_FlashRender;

Step 2: Call a function to init Flash and set timer to get a bitmap buffer for rendering the Flash file:

m_FlashRender.InitFlash();
SetTimer(IDTIMER_FLASH, 40, NULL);

Step 3: Load a Flash file to render.

m_FlashRender2.LoadFlash(sFlashFileName);

Step 4: Edit the Timer function:

void CRenderFlashDlg::OnTimer(UINT nIDEvent) 
{
 // TODO: Add your message handler code here and/or call default

 if (nIDEvent == IDTIMER_FLASH)
 {
   m_FlashRender.DrawFrame();
   BYTE *pFlashBuffer = m_FlashRender.GetFlashBitmapBuffer();
   if (pFlashBuffer)
   {
    int size = m_FlashRender2.GetFlashBitmapSize();   
    // CShowpic m_stcFlashRender

    // CShowpic inherited from CStatic

    m_stcFlashRender.ShowImage(pFlashBuffer );
   }
  }
}

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here