I want to use this dll to get pixels of every frame for real-time processing.I have developed a simple application for playing swf file.some code as follows:
-------------------------------------------------------------------
g_hwndFlashPlayerControl =
CreateWindowEx(WS_EX_LAYERED,
(LPCTSTR)FPC_GetClassAtom(g_hFPC),
NULL,
FPCS_TRANSPARENT,//WS_POPUP | WS_VISIBLE,
0,
0,
600,
600,
NULL,
NULL,
NULL,
NULL);
LPSTR pszFileName = "D:\\mywork\\Flash\\Ripples.swf";
if(FAILED(FPC_LoadMovieA(g_hwndFlashPlayerControl,0,pszFileName)))
{
return;
}
FPC_Play(g_hwndFlashPlayerControl);
FPCSetEventListener(g_hwndFlashPlayerControl, &FPCListener, 0);
-------------------------------------
static
void WINAPI FPCListener(HWND hwndFlashPlayerControl, LPARAM lParam, NMHDR* pNMHDR)
{
if (FPCN_UPDATE_RECT == pNMHDR->code)
{
if (true)
{
SFPCGetFrameBitmap FPCGetFrameBitmap = { 0 };
::SendMessage(g_hwndFlashPlayerControl, FPCM_GET_FRAME_BITMAP, 0, (LPARAM)&FPCGetFrameBitmap);
...
CopyMemory(g_lpPixels, bmp_info.bmBits, g_size.cx * g_size.cy * 4);
...
}
void testApp::draw(){
ofSetColor(0xFFFFFF);
ofImage a;
a.allocate(g_size.cx,g_size.cy,OF_IMAGE_COLOR_ALPHA);
a.setFromPixels((unsigned char *)g_lpPixels,g_size.cx,g_size.cy,OF_IMAGE_COLOR_ALPHA);
a.draw(0,0,600,300);
}
After testing several swf files,I met two problems.
1.speed is slow.Is there a way to speed up getting data from swf?
2.the display image from my application is different from your demo. Can you tell me why? And teach me how to solve it.
Thank you!
[/url]