Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DIRECTX9 - HDC TO SURFACE


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Starkman   Members   -  Reputation: 106

Like
0Likes
Like

Posted 13 January 2013 - 02:55 AM

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.



Sponsor:

#2 Starkman   Members   -  Reputation: 106

Like
0Likes
Like

Posted 13 January 2013 - 08:25 AM

i'v done it 


Edited by Starkman, 13 January 2013 - 08:40 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS