Hi,
I have two applications: The first application contains a Picturebox with a flower image and the second application is based on Directx 9 and contains a directx surface. Now I want to copy the picture box image data(flower) from the first application into the surface of the Directx application. But all I get is a black screen.
LPDIRECT3DDEVICE9 l_Device = My_device ;
LPDIRECT3DSURFACE9 l_SurfaceHDC, l_Surface;
My_3DTexture->GetSurfaceLevel(0,&l_Surface);
HDC hDC = GetDC((HWND)MyPictureBoxHWND); //use WINAPI to get my picturebox DC handle
l_SurfaceHDC->GetDC(&hDC); // i think i'm wrong here but how we can copy flower image data into my surface ?
l_Device->StretchRect(l_SurfaceHDC,NULL, l_Surface,NULL,D3DTEXF_NONE);
l_SurfaceHDC->Release();
l_Device->SetTexture( 0,My_3DTexture);
Thanks.