DarkLotus
February 23rd, 2008, 07:24 AM
How can you draw a Bitmap on an external window using directdrawcreate and friends?
Crude example:
HWND hwnd = FindWindow(NULL, "WindowName");
if (hwnd)
{
DrawBitmapOnWindow(hwnd,"d:\\path\\to\\bitmap.bmp");
}
ramin.zaghi
February 23rd, 2008, 10:52 AM
Once you have the handle to a window (a HWND) it should be fairly easy to do anything with it.
I'm not DirectX expert, however I know that you'll need to
chnage that HWND's window class to get the required support if possible (say support for the right color depth or double buffering),
initialize your DirectDraw rendering target to that HWND,
load your bitmap ( possibly as a DIB in memory ),
create a DirectDraw texture using this in-memory bitmap data,
then create a DirectDraw surface and map that texture onto this surface,
and finally keep drawing using DirectDraw functions and perhaps refreshing the HWND by sending WM_PAINT messages...
That gives you a clue what you need to do ?
Mike Harnad
February 26th, 2008, 08:18 AM
This article (http://www.codeguru.com/cpp/g-m/directx/directdraw/article.php/c1221/) should get you started.