Hello,
I am trying to get a bitmap with alpha channel from the frame, but all I get is a bitmap with black background.
My code looks like this:
I define the flash window:
Code: Select all
// Create FlashPlayerControl as a hidden child control
// in transparent mode (see style FPCS_TRANSPARENT)
g_hwndFlashPlayerControl =
CreateWindowEx(WS_EX_LAYERED,
WC_FLASH,
NULL,
WS_POPUP | WS_VISIBLE,
0,
0,
320,
240,
g_hDlg,
NULL,
NULL,
NULL);
And I get the bitmap using:
Code: Select all
MoveWindow(g_hwndFlashPlayerControl, 0, 0, m_mode->width, m_mode->height, TRUE);
SFPCGetFrameBitmap FPCGetFrameBitmap = { 0 };
::SendMessage(g_hwndFlashPlayerControl, FPCM_GET_FRAME_BITMAP, 0, (LPARAM)&FPCGetFrameBitmap);
HBITMAP pwebcam_HBITMAP = FPCGetFrameBitmap.hBitmap;
HPALETTE hpal = (HPALETTE) GetStockObject(DEFAULT_PALETTE);
Bitmap* pflash_bitmap = Bitmap::FromHBITMAP(pwebcam_HBITMAP, hpal);
The movie is displayed in a transparent window (I use WS_VISIBLE so I can see the flash window) but the bitmap I get has black background.
What am I doing wrong?
Thanks in advance,
Amit