Click here to Skip to main content
15,890,609 members
Articles / Desktop Programming / MFC
Article

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

Rate me:
Please Sign up or sign in to vote.
1.95/5 (8 votes)
30 Mar 2005 117.6K   4.4K   24   27
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:

C++
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


Written By
Software Developer (Senior)
Vietnam Vietnam
Bachelor of Natural Science University, HCMC VietNam

Comments and Discussions

 
QuestionZFlash lib? Pin
Member 360833027-Feb-11 3:21
Member 360833027-Feb-11 3:21 
GeneralIs this project working withVS2005 Pin
00thilani24-Apr-08 17:57
00thilani24-Apr-08 17:57 
GeneralBlack borders Pin
Ouckk13-Sep-07 18:13
Ouckk13-Sep-07 18:13 
AnswerRe: Black borders Pin
strwyvan29-Sep-08 20:06
strwyvan29-Sep-08 20:06 
QuestionCan anybody tell me how to extract audio from SWF files? Pin
Member 226132511-Feb-07 2:25
Member 226132511-Feb-07 2:25 
AnswerRe: Can anybody tell me how to extract audio from SWF files? Pin
James Duy Trinh (VietDoor)11-Feb-07 23:06
James Duy Trinh (VietDoor)11-Feb-07 23:06 
QuestionIs this wroking for anyone ? Pin
what is not registered6-Jun-06 0:25
what is not registered6-Jun-06 0:25 
AnswerRe: Is this wroking for anyone ? Pin
James Duy Trinh (VietDoor)11-Feb-07 23:13
James Duy Trinh (VietDoor)11-Feb-07 23:13 
GeneralRevision Request Pin
what is not registered5-Jun-06 6:42
what is not registered5-Jun-06 6:42 
GeneralRe: Revision Request Pin
James Duy Trinh (VietDoor)5-Jun-06 16:58
James Duy Trinh (VietDoor)5-Jun-06 16:58 
GeneralRe: Revision Request Pin
what is not registered5-Jun-06 22:59
what is not registered5-Jun-06 22:59 
QuestionError..? Pin
Chae Sang, Jung29-Nov-05 20:42
Chae Sang, Jung29-Nov-05 20:42 
AnswerRe: Error..? Pin
James Duy Trinh (VietDoor)29-Nov-05 20:46
James Duy Trinh (VietDoor)29-Nov-05 20:46 
GeneralRe: Error..? Pin
Chae Sang, Jung30-Nov-05 13:47
Chae Sang, Jung30-Nov-05 13:47 
QuestionWhere is whole zflash.lib source? Pin
Chae Sang, Jung29-Nov-05 20:00
Chae Sang, Jung29-Nov-05 20:00 
AnswerRe: Where is whole zflash.lib source? Pin
James Duy Trinh (VietDoor)29-Nov-05 20:43
James Duy Trinh (VietDoor)29-Nov-05 20:43 
GeneralRe: Where is whole zflash.lib source? Pin
Chae Sang, Jung29-Nov-05 21:09
Chae Sang, Jung29-Nov-05 21:09 
GeneralFlash File Parser Pin
Jonas Beckeman28-Jul-05 22:25
Jonas Beckeman28-Jul-05 22:25 
GeneralRe: Flash File Parser Pin
James Duy Trinh (VietDoor)28-Jul-05 22:28
James Duy Trinh (VietDoor)28-Jul-05 22:28 
you can find it on my source. this lib only use a COM Flash.ocx and we will dn't know anything about parsing flash file. Except, we can't know details about Flash.ocx

Cheers,

--------------------------
ERP VN: www.erpvn.net
GeneralRe: Flash File Parser Pin
Jonas Beckeman28-Jul-05 22:47
Jonas Beckeman28-Jul-05 22:47 
GeneralNo file 'dshow.h' in the source document Pin
FlyingDancer23-Jun-05 0:07
FlyingDancer23-Jun-05 0:07 
GeneralRe: No file 'dshow.h' in the source document Pin
James Duy Trinh (VietDoor)23-Jun-05 1:22
James Duy Trinh (VietDoor)23-Jun-05 1:22 
GeneralRe: No file 'dshow.h' in the source document Pin
Anonymous23-Jun-05 1:39
Anonymous23-Jun-05 1:39 
GeneralRe: No file 'dshow.h' in the source document Pin
essetesse12-Jul-07 19:19
essetesse12-Jul-07 19:19 
GeneralWe need to have another powerful flash component Pin
James Duy Trinh (VietDoor)18-May-05 22:06
James Duy Trinh (VietDoor)18-May-05 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.