Starkman

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

106 Neutral

About Starkman

  • Rank
    Newbie
  1. DIRECTX9 - HDC TO SURFACE

    i'v done it 
  2. DIRECTX9 - SURFACE TO TEXTURE

    i think it done on GPU cause i'm not set my texture or surface as a D3DPOOL_SYSTEMMEM.
  3. 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.
  4. DIRECTX9 - SURFACE TO TEXTURE

    Thank you guys your solutions are true and in finally i used  GetRenderTarget with StretchRect() and it's work so fast now. thanks again.
  5. DIRECTX9 - SURFACE TO TEXTURE

    worked and thanks Tispe.   but i need to a faster way (low fps)   is there any way to copy backbuffer into texture ?
  6. hi i want to capture my Backbuffer into LPDIRECT3DSURFACE9 and then copy the surface into IDirect3DTexture9 finally use texture as my 3dobject skin . i wrote the codes but just received black pixels.it seems im wrong way on filling texture by surface .   Thanks for your help     IDirect3DTexture9* texture; LPDIRECT3DSURFACE9 pd3dsBack = NULL;   void init()  {   D3DXCreateTexture(g_pd3dDevice,640,480,D3DUSAGE_DYNAMIC, 0,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&texture);   }   void render()  {   //scene (1) g_pd3dDevice->BeginScene();   g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,                           D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f), 1.0f, 0);   //my 3d objects codes for draw into scene (1) .   g_pd3dDevice->EndScene();   //now try to get back-buffer into surface   g_pd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pd3dsBack)  ;   //i add this Save section to ensure the backbuffer data received complete and work.(it was ok and save complete true picture of Scene(1) ). D3DXSaveSurfaceToFileA("BackbufferImage.BMP", D3DXIFF_BMP,pd3dsBack, NULL, NULL);     //this line fill the surface into texture ; if u think this way is false please give me a simple code to fill texture by surface.thanks    texture->GetSurfaceLevel(0, &pd3dsBack);   pd3dsBack->Release();//release my surface     //scene(2)     g_pd3dDevice->BeginScene();        g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,                           D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f), 1.0f, 0);   //now render my scene(2) and useing the texture object for draw it as skin of my 3d     object g_pd3dDevice->SetTexture( 0, texture );   g_pd3dDevice->EndScene();     g_pd3dDevice->Present( NULL, NULL, NULL, NULL );   }