Hi
Is there any chance of the directx sample being done to use GetDibBits and no transparency please?
Thanks
Scott
Code: Select all
m_hwndFlashPlayerControl =
CreateWindow(WC_FLASH,
NULL,
WS_CHILD | WS_VISIBLE | FPCS_TRANSPARENT, // FPCS_TRANSPARENT is important
rc.left,
rc.top,
rc.right - rc.left,
rc.bottom - rc.top,
m_hWnd,
NULL,
NULL,
NULL);
Code: Select all
FPCSetEventListener(m_hwndFlashPlayerControl, &FPCListener, (LPARAM)this /* or what you want to pass to callback */ );
Code: Select all
static LPDWORD g_lpPixels = NULL;
static SIZE g_size = { 0 };
static
void WINAPI FPCListener(HWND hwndFlashPlayerControl, LPARAM lParam, NMHDR* pNMHDR)
{
if (FPCN_UPDATE_RECT == pNMHDR->code)
{
// FPCN_PAINT is sending in the handler of WM_PAINT
SendMessage(hwndFlashPlayerControl, WM_PAINT, 0, 0);
}
else if (FPCN_PAINT == pNMHDR->code)
{
SFPCNPaint* pFPCNPaint = (SFPCNPaint*)pNMHDR;
LPDWORD lpPixels = pFPCNPaint->lpPixels; // <-- pixels buffer
ATLTRACE(_T("FPCN_PAINT: 0x%.8x\n"), (DWORD)lpPixels);
RECT rc;
GetClientRect(hwndFlashPlayerControl, &rc);
if (g_size.cx != rc.right || g_size.cy != rc.bottom)
{
if (NULL != g_lpPixels)
delete[] g_lpPixels;
g_size.cx = rc.right;
g_size.cy = rc.bottom;
g_lpPixels = new DWORD[g_size.cx * g_size.cy];
}
CopyMemory(g_lpPixels, lpPixels, g_size.cx * g_size.cy * sizeof(DWORD));
// You can copy lpPixels into internal buffer or create what you want from this buffer (bitmaps, textures, etc.)
// Note that lpPixels is temporary and you shouldn't save this pointer for futher using
}
}
Users browsing this forum: No registered users and 138 guests